diff options
Diffstat (limited to 'test/cpp/util/time_test.cc')
-rw-r--r-- | test/cpp/util/time_test.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/cpp/util/time_test.cc b/test/cpp/util/time_test.cc index a3cfb1c961..1770a80574 100644 --- a/test/cpp/util/time_test.cc +++ b/test/cpp/util/time_test.cc @@ -47,6 +47,7 @@ class TimeTest : public ::testing::Test {}; TEST_F(TimeTest, AbsolutePointTest) { long us = 10000000L; gpr_timespec ts = gpr_time_from_micros(us); + ts.clock_type = GPR_CLOCK_REALTIME; system_clock::time_point tp{microseconds(us)}; system_clock::time_point tp_converted = Timespec2Timepoint(ts); gpr_timespec ts_converted; @@ -61,15 +62,17 @@ TEST_F(TimeTest, AbsolutePointTest) { // gpr_inf_future is treated specially and mapped to/from time_point::max() TEST_F(TimeTest, InfFuture) { EXPECT_EQ(system_clock::time_point::max(), - Timespec2Timepoint(gpr_inf_future)); + Timespec2Timepoint(gpr_inf_future(GPR_CLOCK_REALTIME))); gpr_timespec from_time_point_max; Timepoint2Timespec(system_clock::time_point::max(), &from_time_point_max); - EXPECT_EQ(0, gpr_time_cmp(gpr_inf_future, from_time_point_max)); + EXPECT_EQ( + 0, gpr_time_cmp(gpr_inf_future(GPR_CLOCK_REALTIME), from_time_point_max)); // This will cause an overflow Timepoint2Timespec( std::chrono::time_point<system_clock, std::chrono::seconds>::max(), &from_time_point_max); - EXPECT_EQ(0, gpr_time_cmp(gpr_inf_future, from_time_point_max)); + EXPECT_EQ( + 0, gpr_time_cmp(gpr_inf_future(GPR_CLOCK_REALTIME), from_time_point_max)); } } // namespace |