[Libreoffice-commits] online.git: test/WhiteBoxTests.cpp

DarkByt31 (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 4 21:18:55 UTC 2019


 test/WhiteBoxTests.cpp |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit d24071e91bbfbc8ef3cd5eedc1d1179db6a5a1a0
Author:     DarkByt31 <avihs.29 at gmail.com>
AuthorDate: Wed Sep 4 22:04:36 2019 +0530
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed Sep 4 22:09:50 2019 +0100

    WhiteBoxTests: testTime corrections
    
    Change-Id: Ia73a69396ba12921370fa12b57c249593c36e3d8

diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
index 35c6faf5b..e3a6d52a8 100644
--- a/test/WhiteBoxTests.cpp
+++ b/test/WhiteBoxTests.cpp
@@ -40,6 +40,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST(testAuthorization);
     CPPUNIT_TEST(testJson);
     CPPUNIT_TEST(testAnonymization);
+    CPPUNIT_TEST(testTime);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -746,16 +747,19 @@ void WhiteBoxTests::testTime()
     oss << t.time_since_epoch().count();
     CPPUNIT_ASSERT_EQUAL(std::string("1567444337874777000"), oss.str());
 
+    oss.str(std::string());
     t = Util::iso8601ToTimestamp("1970-01-01T00:00:00.000000Z", "LastModifiedTime");
     oss << t.time_since_epoch().count();
     CPPUNIT_ASSERT_EQUAL(std::string("0"), oss.str());
 
+    oss.str(std::string());
     t = std::chrono::system_clock::now();
     uint64_t t_in_micros = (t.time_since_epoch().count() / 1000) * 1000;
     oss << t_in_micros;
     std::string first = oss.str();
     std::string s = Util::getIso8601FracformatTime(t);
     t = Util::iso8601ToTimestamp(s, "LastModifiedTime");
+    oss.str(std::string());
     oss << t.time_since_epoch().count();
     CPPUNIT_ASSERT_EQUAL(first, oss.str());
 }


More information about the Libreoffice-commits mailing list