aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/timer_list_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/iomgr/timer_list_test.c')
-rw-r--r--test/core/iomgr/timer_list_test.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c
index 88a9f6b855..2a3a47ccf9 100644
--- a/test/core/iomgr/timer_list_test.c
+++ b/test/core/iomgr/timer_list_test.c
@@ -88,17 +88,19 @@ static void add_test(void) {
/* collect timers. Only the first batch should be ready. */
GPR_ASSERT(grpc_timer_check(
- &exec_ctx, gpr_time_add(start, gpr_time_from_millis(500, GPR_TIMESPAN)),
- NULL));
+ &exec_ctx,
+ gpr_time_add(start, gpr_time_from_millis(500, GPR_TIMESPAN)),
+ NULL) == GRPC_TIMERS_FIRED);
grpc_exec_ctx_finish(&exec_ctx);
for (i = 0; i < 20; i++) {
GPR_ASSERT(cb_called[i][1] == (i < 10));
GPR_ASSERT(cb_called[i][0] == 0);
}
- GPR_ASSERT(!grpc_timer_check(
- &exec_ctx, gpr_time_add(start, gpr_time_from_millis(600, GPR_TIMESPAN)),
- NULL));
+ GPR_ASSERT(grpc_timer_check(
+ &exec_ctx,
+ gpr_time_add(start, gpr_time_from_millis(600, GPR_TIMESPAN)),
+ NULL) == GRPC_TIMERS_CHECKED_AND_EMPTY);
grpc_exec_ctx_finish(&exec_ctx);
for (i = 0; i < 30; i++) {
GPR_ASSERT(cb_called[i][1] == (i < 10));
@@ -107,17 +109,19 @@ static void add_test(void) {
/* collect the rest of the timers */
GPR_ASSERT(grpc_timer_check(
- &exec_ctx, gpr_time_add(start, gpr_time_from_millis(1500, GPR_TIMESPAN)),
- NULL));
+ &exec_ctx,
+ gpr_time_add(start, gpr_time_from_millis(1500, GPR_TIMESPAN)),
+ NULL) == GRPC_TIMERS_FIRED);
grpc_exec_ctx_finish(&exec_ctx);
for (i = 0; i < 30; i++) {
GPR_ASSERT(cb_called[i][1] == (i < 20));
GPR_ASSERT(cb_called[i][0] == 0);
}
- GPR_ASSERT(!grpc_timer_check(
- &exec_ctx, gpr_time_add(start, gpr_time_from_millis(1600, GPR_TIMESPAN)),
- NULL));
+ GPR_ASSERT(grpc_timer_check(
+ &exec_ctx,
+ gpr_time_add(start, gpr_time_from_millis(1600, GPR_TIMESPAN)),
+ NULL) == GRPC_TIMERS_CHECKED_AND_EMPTY);
for (i = 0; i < 30; i++) {
GPR_ASSERT(cb_called[i][1] == (i < 20));
GPR_ASSERT(cb_called[i][0] == 0);
@@ -163,7 +167,7 @@ void destruction_test(void) {
&exec_ctx, &timers[4], tfm(1),
grpc_closure_create(cb, (void *)(intptr_t)4, grpc_schedule_on_exec_ctx),
gpr_time_0(GPR_CLOCK_REALTIME));
- GPR_ASSERT(1 == grpc_timer_check(&exec_ctx, tfm(2), NULL));
+ GPR_ASSERT(grpc_timer_check(&exec_ctx, tfm(2), NULL) == GRPC_TIMERS_FIRED);
grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(1 == cb_called[4][1]);
grpc_timer_cancel(&exec_ctx, &timers[0]);