aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-02 12:56:26 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-02 12:56:26 -0700
commit79e11c6d058f397003c6528f5773c067ccb2fcb7 (patch)
tree2d896256242055a95ff63c5f471fb3518759dc03 /test/core/surface
parente398fa2b5264d855ea81c160bf84ec5bd3320237 (diff)
parent19fdb33da268b4ded64c64bd7bde7b75714ab0a0 (diff)
Merge github.com:grpc/grpc into we-dont-need-no-backup
Diffstat (limited to 'test/core/surface')
-rw-r--r--test/core/surface/completion_queue_test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c
index bca517349c..f009b5fa06 100644
--- a/test/core/surface/completion_queue_test.c
+++ b/test/core/surface/completion_queue_test.c
@@ -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;
@@ -289,6 +309,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);