aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/time_test.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-07-13 09:16:03 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-07-13 09:16:03 -0700
commit354398f9f5191bb44198b94e1828eafb60de5a67 (patch)
tree716e16fa3c813b5b02344eba8e341c27fd40840c /test/cpp/util/time_test.cc
parent75cfb044f3c5582a50582c375b443ee4ab029c33 (diff)
Updating wrapped languages to new time functions
Diffstat (limited to 'test/cpp/util/time_test.cc')
-rw-r--r--test/cpp/util/time_test.cc9
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