Skip to content

Commit

Permalink
Add a completion queue test
Browse files Browse the repository at this point in the history
- create completion queue
- call shutdown
- call next
  • Loading branch information
ctiller committed Jun 2, 2015
1 parent 1b932e7 commit 59657db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/core/surface/completion_queue_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ static void test_cq_end_op(void) {
shutdown_and_destroy(cc);
}

static void test_shutdown_then_next(void) {
grpc_completion_queue *cc;
LOG_TEST("test_shutdown_then_next");

cc = grpc_completion_queue_create();
grpc_completion_queue_shutdown(cc);
GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_past).type == GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(cc);
}

static void test_pluck(void) {
grpc_event ev;
grpc_completion_queue *cc;
Expand Down Expand Up @@ -291,6 +301,7 @@ int main(int argc, char **argv) {
grpc_iomgr_init();
test_no_op();
test_wait_empty();
test_shutdown_then_next();
test_cq_end_op();
test_pluck();
test_threading(1, 1);
Expand Down

0 comments on commit 59657db

Please sign in to comment.