Fix a couple of tests.

pull/7970/head
Mark D. Roth 8 years ago
parent 1e35b69788
commit b3a4f906af
  1. 10
      test/core/end2end/invalid_call_argument_test.c
  2. 16
      test/core/end2end/tests/negative_deadline.c

@ -304,6 +304,11 @@ static void test_receive_initial_metadata_twice_at_client() {
grpc_op *op; grpc_op *op;
prepare_test(1); prepare_test(1);
op = g_state.ops; op = g_state.ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA; op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &g_state.initial_metadata_recv; op->data.recv_initial_metadata = &g_state.initial_metadata_recv;
op->flags = 0; op->flags = 0;
@ -392,6 +397,11 @@ static void test_recv_status_on_client_twice() {
prepare_test(1); prepare_test(1);
op = g_state.ops; op = g_state.ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = op->data.recv_status_on_client.trailing_metadata =
&g_state.trailing_metadata_recv; &g_state.trailing_metadata_recv;

@ -122,6 +122,11 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) {
memset(ops, 0, sizeof(ops)); memset(ops, 0, sizeof(ops));
op = ops; op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status; op->data.recv_status_on_client.status = &status;
@ -135,15 +140,14 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) {
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;
// Need to send at least the SEND_INITIAL_METADATA and
// RECV_STATUS_ON_CLIENT ops, since the former allows the client to set
// the deadline timer, and the latter returns status to the test.
GPR_ASSERT(num_ops >= 2);
GPR_ASSERT(num_ops <= (size_t)(op - ops)); GPR_ASSERT(num_ops <= (size_t)(op - ops));
error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL); error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL);
GPR_ASSERT(GRPC_CALL_OK == error); GPR_ASSERT(GRPC_CALL_OK == error);
@ -174,7 +178,7 @@ static void test_invoke_simple_request(grpc_end2end_test_config config,
void negative_deadline(grpc_end2end_test_config config) { void negative_deadline(grpc_end2end_test_config config) {
size_t i; size_t i;
for (i = 1; i <= 4; i++) { for (i = 2; i <= 4; i++) {
test_invoke_simple_request(config, i); test_invoke_simple_request(config, i);
} }
} }

Loading…
Cancel
Save