Skip to content
Snippets Groups Projects
Commit 667ca409 authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix new tests in C core

parent 5fdcbb7f
No related branches found
No related tags found
No related merge requests found
...@@ -67,14 +67,10 @@ static gpr_timespec n_seconds_time(int n) { ...@@ -67,14 +67,10 @@ static gpr_timespec n_seconds_time(int n) {
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) { static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev; grpc_event ev;
grpc_completion_type type;
do { do {
ev = grpc_completion_queue_next(cq, five_seconds_time()); ev = grpc_completion_queue_next(cq, five_seconds_time());
GPR_ASSERT(ev); } while (ev.type != GRPC_QUEUE_SHUTDOWN);
type = ev->type;
grpc_event_finish(ev);
} while (type != GRPC_QUEUE_SHUTDOWN);
} }
static void shutdown_server(grpc_end2end_test_fixture *f) { static void shutdown_server(grpc_end2end_test_fixture *f) {
...@@ -168,7 +164,7 @@ static void test_max_message_length(grpc_end2end_test_config config) { ...@@ -168,7 +164,7 @@ static void test_max_message_length(grpc_end2end_test_config config) {
&call_details, &call_details,
&request_metadata_recv, &request_metadata_recv,
f.server_cq, tag(101))); f.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); cq_verify(v_server);
op = ops; op = ops;
...@@ -177,10 +173,10 @@ static void test_max_message_length(grpc_end2end_test_config config) { ...@@ -177,10 +173,10 @@ static void test_max_message_length(grpc_end2end_test_config config) {
op++; op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); 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_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); cq_verify(v_client);
GPR_ASSERT(status == GRPC_STATUS_CANCELLED); GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
... ...
......
...@@ -69,14 +69,10 @@ static gpr_timespec n_seconds_time(int n) { ...@@ -69,14 +69,10 @@ static gpr_timespec n_seconds_time(int n) {
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) { static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev; grpc_event ev;
grpc_completion_type type;
do { do {
ev = grpc_completion_queue_next(cq, five_seconds_time()); ev = grpc_completion_queue_next(cq, five_seconds_time());
GPR_ASSERT(ev); } while (ev.type != GRPC_QUEUE_SHUTDOWN);
type = ev->type;
grpc_event_finish(ev);
} while (type != GRPC_QUEUE_SHUTDOWN);
} }
static void shutdown_server(grpc_end2end_test_fixture *f) { static void shutdown_server(grpc_end2end_test_fixture *f) {
...@@ -151,7 +147,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { ...@@ -151,7 +147,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
&call_details, &call_details,
&request_metadata_recv, &request_metadata_recv,
f.server_cq, tag(101))); f.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); cq_verify(v_server);
op = ops; op = ops;
...@@ -168,10 +164,10 @@ static void simple_request_body(grpc_end2end_test_fixture f) { ...@@ -168,10 +164,10 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++; op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); 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_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); cq_verify(v_client);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment