From 437bd5a9a406f5b07dc58bae612b75f4e6a23a13 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 8 Dec 2015 10:32:40 +0100 Subject: [PATCH] src/daemon/utils_time_test.c: Check the "tv_sec" field of struct time{val,spec}. Also fixes an incorrect "expected" test value. Issue: #1446 --- src/daemon/utils_time_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/daemon/utils_time_test.c b/src/daemon/utils_time_test.c index 8eac0b62..255286f4 100644 --- a/src/daemon/utils_time_test.c +++ b/src/daemon/utils_time_test.c @@ -62,7 +62,7 @@ DEF_TEST(conversion) // 1546167831554815222 / 2^30 = 1439981005.6712620165... {1546167831554815222ULL, 1439981005.671, 1439981006, 1439981005671ULL, {1439981005, 671262}, {1439981005, 671262017}}, // 1546167986577716567 / 2^30 = 1439981150.0475896215... - {1546167986577716567ULL, 1439981150.048, 1439981150, 1439981150048ULL, {1439981150, 47590}, {1439981005, 47589622}}, + {1546167986577716567ULL, 1439981150.048, 1439981150, 1439981150048ULL, {1439981150, 47590}, {1439981150, 47589622}}, }; size_t i; @@ -78,10 +78,12 @@ DEF_TEST(conversion) // cdtime -> us CDTIME_T_TO_TIMEVAL (cases[i].t, &tv); + EXPECT_EQ_UINT64 (cases[i].tv.tv_sec, tv.tv_sec); EXPECT_EQ_UINT64 (cases[i].tv.tv_usec, tv.tv_usec); // cdtime -> ns CDTIME_T_TO_TIMESPEC (cases[i].t, &ts); + EXPECT_EQ_UINT64 (cases[i].ts.tv_sec, ts.tv_sec); EXPECT_EQ_UINT64 (cases[i].ts.tv_nsec, ts.tv_nsec); // cdtime -> double -- 2.30.2