From 65b0759653bf36e6ed71e61f57796b85ab6f5ac9 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Mon, 23 Feb 2015 15:28:04 -0800 Subject: Addressing a first batch of feedback. --- test/core/support/time_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/core/support') diff --git a/test/core/support/time_test.c b/test/core/support/time_test.c index 2741e17f95..c1dce777b0 100644 --- a/test/core/support/time_test.c +++ b/test/core/support/time_test.c @@ -81,7 +81,7 @@ static void ts_to_s(gpr_timespec t, void *arg) { if (t.tv_sec < 0 && t.tv_nsec != 0) { t.tv_sec++; - t.tv_nsec = 1000000000 - t.tv_nsec; + t.tv_nsec = GPR_NS_PER_SEC - t.tv_nsec; } i_to_s(t.tv_sec, 10, 0, writer, arg); (*writer)(arg, ".", 1); @@ -127,15 +127,15 @@ static void test_values(void) { /* Test possible overflow in conversion of -ve values. */ x = gpr_time_from_micros(-(LONG_MAX - 999997)); GPR_ASSERT(x.tv_sec < 0); - GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < 1000000000); + GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC); x = gpr_time_from_nanos(-(LONG_MAX - 999999997)); GPR_ASSERT(x.tv_sec < 0); - GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < 1000000000); + GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC); x = gpr_time_from_millis(-(LONG_MAX - 997)); GPR_ASSERT(x.tv_sec < 0); - GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < 1000000000); + GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC); /* Test general -ve values. */ for (i = -1; i > -1000 * 1000 * 1000; i *= 7) { -- cgit v1.2.3