diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
commit | 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch) | |
tree | f5944309621cee4fe0976be6f9ac619b7ebfc4c2 /unittests/Support/TimeValueTest.cpp | |
parent | 68bcb7db193e4bc81430063148253d30a791023e (diff) |
Diffstat (limited to 'unittests/Support/TimeValueTest.cpp')
-rw-r--r-- | unittests/Support/TimeValueTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unittests/Support/TimeValueTest.cpp b/unittests/Support/TimeValueTest.cpp index fb2abe382932..3d2b9780c069 100644 --- a/unittests/Support/TimeValueTest.cpp +++ b/unittests/Support/TimeValueTest.cpp @@ -16,8 +16,8 @@ namespace { TEST(TimeValue, time_t) { sys::TimeValue now = sys::TimeValue::now(); - time_t now_t = time(NULL); - EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2); + time_t now_t = time(nullptr); + EXPECT_TRUE(std::abs(static_cast<long>(now_t - now.toEpochTime())) < 2); } TEST(TimeValue, Win32FILETIME) { @@ -30,7 +30,8 @@ TEST(TimeValue, Win32FILETIME) { epoch.fromWin32Time(ft1970); // The "seconds" part in Posix time may be expected as zero. - EXPECT_EQ(ns / 100, epoch.toPosixTime()); + EXPECT_EQ(0u, epoch.toEpochTime()); + EXPECT_EQ(ns, static_cast<uint32_t>(epoch.nanoseconds())); // Confirm it reversible. EXPECT_EQ(ft1970, epoch.toWin32Time()); |