diff options
author | yang-g <yangg@google.com> | 2015-12-08 08:00:24 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-12-08 08:00:24 -0800 |
commit | 1ed62e4efc5dd59a94122a55e06ca1e56571b3d5 (patch) | |
tree | 26010e8f04ee4ba5f831e8da1e87b0e999e9f419 | |
parent | fc4399411cfeb86bf6e29c2067cb8ddc352c3e25 (diff) |
add test for pluck after shutdown
-rw-r--r-- | test/core/surface/completion_queue_test.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index e3fc789788..7a5cf30506 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -175,6 +175,19 @@ static void test_pluck(void) { grpc_exec_ctx_finish(&exec_ctx); } +static void test_pluck_after_shutdown(void) { + grpc_event ev; + grpc_completion_queue *cc; + + LOG_TEST("test_pluck_after_shutdown"); + cc = grpc_completion_queue_create(NULL); + grpc_completion_queue_shutdown(cc); + ev = grpc_completion_queue_pluck(cc, NULL, gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); + GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); + grpc_completion_queue_destroy(cc); +} + #define TEST_THREAD_EVENTS 10000 typedef struct test_thread_options { @@ -343,6 +356,7 @@ int main(int argc, char **argv) { test_shutdown_then_next_with_timeout(); test_cq_end_op(); test_pluck(); + test_pluck_after_shutdown(); test_threading(1, 1); test_threading(1, 10); test_threading(10, 1); |