Skip to content

Commit

Permalink
Merge pull request grpc#1864 from ctiller/cq-says-what
Browse files Browse the repository at this point in the history
Add a completion queue test
  • Loading branch information
jtattermusch committed Jun 2, 2015
2 parents 8668674 + c0c4844 commit 206e6e8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 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,26 @@ static void test_cq_end_op(void) {
shutdown_and_destroy(cc);
}

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

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_shutdown_then_next_with_timeout(void) {
grpc_completion_queue *cc;
LOG_TEST("test_shutdown_then_next_with_timeout");

cc = grpc_completion_queue_create();
grpc_completion_queue_shutdown(cc);
GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_future).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 +311,8 @@ int main(int argc, char **argv) {
grpc_iomgr_init();
test_no_op();
test_wait_empty();
test_shutdown_then_next_polling();
test_shutdown_then_next_with_timeout();
test_cq_end_op();
test_pluck();
test_threading(1, 1);
Expand Down

0 comments on commit 206e6e8

Please sign in to comment.