diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2015-12-10 10:54:12 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2015-12-10 15:04:59 -0800 |
commit | 88086373db8c1d933f40d0275c4b9c8a8c9b9723 (patch) | |
tree | 6a84447994f72b97b3e2427ad7f567cfb729c7f7 /test | |
parent | 07c4b573cff8de30e25e76f96617019d2199961a (diff) |
make gpr_timespec platform agnostic
Diffstat (limited to 'test')
-rw-r--r-- | test/core/iomgr/tcp_client_posix_test.c | 5 | ||||
-rw-r--r-- | test/core/support/sync_test.c | 2 | ||||
-rw-r--r-- | test/core/support/time_test.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index a61cccdb02..833ceace54 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -234,8 +234,9 @@ void test_times_out(void) { if (gpr_time_cmp(now, finish_time) > 0) { break; } - gpr_log(GPR_DEBUG, "now=%d.%09d connect_deadline=%d.%09d", now.tv_sec, - now.tv_nsec, connect_deadline.tv_sec, connect_deadline.tv_nsec); + gpr_log(GPR_DEBUG, "now=%lld.%09d connect_deadline=%lld.%09d", + (long long)now.tv_sec, (int)now.tv_nsec, + (long long)connect_deadline.tv_sec, (int)connect_deadline.tv_nsec); if (is_after_deadline && gpr_time_cmp(now, restart_verifying_time) <= 0) { /* allow some slack before insisting that things be done */ } else { diff --git a/test/core/support/sync_test.c b/test/core/support/sync_test.c index 6bc5f792e5..e538af93f2 100644 --- a/test/core/support/sync_test.c +++ b/test/core/support/sync_test.c @@ -272,7 +272,7 @@ static void test(const char *name, void (*body)(void *m), test_destroy(m); } time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start); - fprintf(stderr, " done %ld.%09d s\n", (long)time_taken.tv_sec, + fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec, (int)time_taken.tv_nsec); } diff --git a/test/core/support/time_test.c b/test/core/support/time_test.c index ce35edd83c..b921052e7b 100644 --- a/test/core/support/time_test.c +++ b/test/core/support/time_test.c @@ -98,7 +98,7 @@ static void test_values(void) { fprintf(stderr, "far future "); i_to_s(x.tv_sec, 16, 16, &to_fp, stderr); fprintf(stderr, "\n"); - GPR_ASSERT(x.tv_sec >= INT_MAX); + GPR_ASSERT(x.tv_sec == INT64_MAX); fprintf(stderr, "far future "); ts_to_s(x, &to_fp, stderr); fprintf(stderr, "\n"); @@ -107,7 +107,7 @@ static void test_values(void) { fprintf(stderr, "far past "); i_to_s(x.tv_sec, 16, 16, &to_fp, stderr); fprintf(stderr, "\n"); - GPR_ASSERT(x.tv_sec <= INT_MIN); + GPR_ASSERT(x.tv_sec == INT64_MIN); fprintf(stderr, "far past "); ts_to_s(x, &to_fp, stderr); fprintf(stderr, "\n"); |