diff options
Diffstat (limited to 'test/core/transport/timeout_encoding_test.c')
-rw-r--r-- | test/core/transport/timeout_encoding_test.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/core/transport/timeout_encoding_test.c b/test/core/transport/timeout_encoding_test.c index 3010c6d057..30357faed3 100644 --- a/test/core/transport/timeout_encoding_test.c +++ b/test/core/transport/timeout_encoding_test.c @@ -102,18 +102,20 @@ void decode_suite(char ext, grpc_millis (*answer)(int64_t x)) { } static grpc_millis millis_from_nanos(int64_t x) { - return x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0); + return (grpc_millis)(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0)); } static grpc_millis millis_from_micros(int64_t x) { - return x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0); + return (grpc_millis)(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0)); +} +static grpc_millis millis_from_millis(int64_t x) { return (grpc_millis)x; } +static grpc_millis millis_from_seconds(int64_t x) { + return (grpc_millis)(x * GPR_MS_PER_SEC); } -static grpc_millis millis_from_millis(int64_t x) { return x; } -static grpc_millis millis_from_seconds(int64_t x) { return x * GPR_MS_PER_SEC; } static grpc_millis millis_from_minutes(int64_t x) { - return x * 60 * GPR_MS_PER_SEC; + return (grpc_millis)(x * 60 * GPR_MS_PER_SEC); } static grpc_millis millis_from_hours(int64_t x) { - return x * 3600 * GPR_MS_PER_SEC; + return (grpc_millis)(x * 3600 * GPR_MS_PER_SEC); } void test_decoding(void) { |