diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/surface/alarm_test.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index baaa05928e..6971d92074 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -73,6 +73,21 @@ static void test_alarm(void) { GPR_ASSERT(ev.success == 0); grpc_alarm_destroy(alarm); } + { + /* alarm_destroy before cq_next */ + grpc_event ev; + void *tag = create_test_tag(); + grpc_alarm *alarm = + grpc_alarm_create(cc, grpc_timeout_seconds_to_deadline(2), tag); + + grpc_alarm_destroy(alarm); + ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), + NULL); + GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); + GPR_ASSERT(ev.tag == tag); + GPR_ASSERT(ev.success == 0); + } + shutdown_and_destroy(cc); } |