From 64be9f7a30a4bcb9ce3647f11ba9e06994aa3bb7 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 4 May 2015 14:53:51 -0700 Subject: C Core API cleanup. Simplify grpc_event into something that can be non-heap allocated. Deprecate grpc_event_finish. Remove grpc_op_error - use an int as this is more idiomatic C style. --- test/core/end2end/dualstack_socket_test.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'test/core/end2end/dualstack_socket_test.c') diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 5e278ca66c..92bb49b9ab 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -50,15 +50,10 @@ static gpr_timespec ms_from_now(int ms) { } static void drain_cq(grpc_completion_queue *cq) { - grpc_event *ev; - grpc_completion_type type; + grpc_event ev; do { ev = grpc_completion_queue_next(cq, ms_from_now(5000)); - GPR_ASSERT(ev); - type = ev->type; - grpc_event_finish(ev); - gpr_log(GPR_INFO, "Drained event type %d", type); - } while (type != GRPC_QUEUE_SHUTDOWN); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); } void test_connect(const char *server_host, const char *client_host, int port, @@ -159,7 +154,7 @@ void test_connect(const char *server_host, const char *client_host, int port, &call_details, &request_metadata_recv, server_cq, tag(101))); - cq_expect_completion(v_server, tag(101), GRPC_OP_OK); + cq_expect_completion(v_server, tag(101), 1); cq_verify(v_server); op = ops; @@ -177,10 +172,10 @@ void test_connect(const char *server_host, const char *client_host, int port, GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); - cq_expect_completion(v_server, tag(102), GRPC_OP_OK); + cq_expect_completion(v_server, tag(102), 1); cq_verify(v_server); - cq_expect_completion(v_client, tag(1), GRPC_OP_OK); + cq_expect_completion(v_client, tag(1), 1); cq_verify(v_client); GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); @@ -192,7 +187,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_call_destroy(s); } else { /* Check for a failed connection. */ - cq_expect_completion(v_client, tag(1), GRPC_OP_OK); + cq_expect_completion(v_client, tag(1), 1); cq_verify(v_client); GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED); -- cgit v1.2.3