diff options
author | Nicolas Noble <nnoble@google.com> | 2015-02-23 15:28:04 -0800 |
---|---|---|
committer | Nicolas Noble <nnoble@google.com> | 2015-02-23 15:38:52 -0800 |
commit | 65b0759653bf36e6ed71e61f57796b85ab6f5ac9 (patch) | |
tree | fdf9241644f6686f6836219fa59c731574471b54 /test/core/support | |
parent | 74ae8f61d9cbc51d532b6ad98185094c1912a624 (diff) |
Addressing a first batch of feedback.
Diffstat (limited to 'test/core/support')
-rw-r--r-- | test/core/support/time_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) { |