diff options
author | DarkByt31 <avihs.29@gmail.com> | 2019-09-27 22:26:16 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-09-28 12:26:32 +0200 |
commit | dd014e7029628dd95d2026bcb4fe4a66d75785aa (patch) | |
tree | 0f3f367a34c7948a597b77c4035ac47bb5bb494f /test/WhiteBoxTests.cpp | |
parent | 022224b7b4bc6195cc9a7e6f637edd86574f0059 (diff) |
tdf#107038 Poco::Timestamp replacement with std::chrono
Util added getHttpTime
WhiteBoxTests added test for getHttpTime
Change-Id: Ifb6a3fb2dc9b059b925e7b881362b72759a8b56b
Reviewed-on: https://gerrit.libreoffice.org/79754
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'test/WhiteBoxTests.cpp')
-rw-r--r-- | test/WhiteBoxTests.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp index e3a6d52a8..6bb74f677 100644 --- a/test/WhiteBoxTests.cpp +++ b/test/WhiteBoxTests.cpp @@ -762,6 +762,12 @@ void WhiteBoxTests::testTime() oss.str(std::string()); oss << t.time_since_epoch().count(); CPPUNIT_ASSERT_EQUAL(first, oss.str()); + + t = std::chrono::system_clock::time_point(); + CPPUNIT_ASSERT_EQUAL(std::string("Thu, 01 Jan 1970 00:00:00"), Util::getHttpTime(t)); + + t = std::chrono::system_clock::time_point(std::chrono::nanoseconds(1569592993495336798)); + CPPUNIT_ASSERT_EQUAL(std::string("Fri, 27 Sep 2019 14:03:13"), Util::getHttpTime(t)); } CPPUNIT_TEST_SUITE_REGISTRATION(WhiteBoxTests); |