diff options
Diffstat (limited to 'test/core')
65 files changed, 240 insertions, 215 deletions
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index 9bc1f738bc..fb52fe3270 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -76,7 +76,7 @@ static void channel_func(grpc_channel_element *elem, ++*(int *)(elem->channel_data); } -static void test_create_channel_stack() { +static void test_create_channel_stack(void) { const grpc_channel_filter filter = { call_func, channel_func, diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 583f187a23..d1e593564f 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -145,7 +145,7 @@ static gpr_slice create_test_value(test_value id) { return gpr_slice_from_copied_string("bad value"); } -static void test_bad_data() { +static void test_bad_data(void) { gpr_slice_buffer input; gpr_slice_buffer output; int i; diff --git a/test/core/echo/server.c b/test/core/echo/server.c index e70743af22..35f118dc9b 100644 --- a/test/core/echo/server.c +++ b/test/core/echo/server.c @@ -56,7 +56,7 @@ typedef struct { gpr_intmax bytes_read; } call_state; -static void request_call() { +static void request_call(void) { call_state *tag = gpr_malloc(sizeof(*tag)); gpr_ref_init(&tag->pending_ops, 2); tag->bytes_read = 0; @@ -124,7 +124,9 @@ int main(int argc, char **argv) { case GRPC_SERVER_RPC_NEW: if (ev->call != NULL) { /* initial ops are already started in request_call */ - grpc_call_accept(ev->call, cq, s, GRPC_WRITE_BUFFER_HINT); + grpc_call_server_accept(ev->call, cq, s); + grpc_call_server_end_initial_metadata(ev->call, + GRPC_WRITE_BUFFER_HINT); GPR_ASSERT(grpc_call_start_read(ev->call, s) == GRPC_CALL_OK); request_call(); } else { diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index b765d3d43e..e8c87d775b 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -127,7 +127,8 @@ void test_connect(const char *server_host, const char *client_host, int port, deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 68d88903de..00de353b35 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -131,7 +131,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c index 19d240471e..8351ad6b37 100644 --- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c +++ b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c @@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -131,7 +131,8 @@ static void test_cancel_after_accept_and_writes_closed( deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index ad0dd0c9ec..0852668522 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index e523fa2f76..150139cd88 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -68,7 +68,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index 1a4dfa7b73..0c684acf0a 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -70,7 +70,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c index 95bbefe381..719f0fe662 100644 --- a/test/core/end2end/tests/census_simple_request.c +++ b/test/core/end2end/tests/census_simple_request.c @@ -120,7 +120,8 @@ static void test_body(grpc_end2end_test_fixture f) { deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index d30e9eae5f..036fdc2501 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -52,7 +52,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -112,7 +112,9 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f, deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f->server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_accept(s, f->server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c index 824d9eba88..66e3c44f4b 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -126,7 +126,8 @@ static void test_early_server_shutdown_finishes_inflight_calls( deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c index eb3eb7c07a..88f735c8e0 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index bacecde01b..f187eceadb 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -100,7 +100,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->client_cq); } -static gpr_slice large_slice() { +static gpr_slice large_slice(void) { gpr_slice slice = gpr_slice_malloc(1000000); memset(GPR_SLICE_START_PTR(slice), 0xab, GPR_SLICE_LENGTH(slice)); return slice; @@ -141,7 +141,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { deadline, NULL); cq_verify(v_server); - grpc_call_accept(s, f.server_cq, tag(102), 0); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index e58b31a7cc..a177a7b2f2 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -124,7 +124,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); @@ -211,7 +212,9 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { "test.google.com", deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s1, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_accept(s1, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s1, 0)); cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL); cq_verify(v_client); @@ -235,7 +238,9 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { "test.google.com", deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s2, f.server_cq, tag(202), 0)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_accept(s2, f.server_cq, tag(202))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s2, 0)); cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c index 4039f2baf3..bd4ff06701 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.c @@ -62,7 +62,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 1801d34a2e..6768bd8aa9 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -129,7 +129,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com", deadline, NULL); cq_verify(v_server); - grpc_call_accept(s, f.server_cq, tag(102), 0); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c index c6048bf96a..1dd798dc8d 100644 --- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c index ebf5a3aed3..cfc9b61f56 100644 --- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/request_response_with_payload.c index b2c39e8d6d..32bf5129ff 100644 --- a/test/core/end2end/tests/request_response_with_payload.c +++ b/test/core/end2end/tests/request_response_with_payload.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -139,7 +139,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) { deadline, NULL); cq_verify(v_server); - grpc_call_accept(s, f.server_cq, tag(102), 0); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c index 8fbe514bf3..4f1de8b466 100644 --- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c +++ b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/request_with_large_metadata.c index 3c634a396d..83628449a2 100644 --- a/test/core/end2end/tests/request_with_large_metadata.c +++ b/test/core/end2end/tests/request_with_large_metadata.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index db10fac6f5..a352783965 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 6e2e16714a..1e15eaa9cc 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -52,7 +52,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -122,7 +122,9 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f->server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_accept(s, f->server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 58d8023090..23fc201d84 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -124,7 +124,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) { deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); @@ -169,7 +170,8 @@ static void simple_request_body2(grpc_end2end_test_fixture f) { deadline, NULL); cq_verify(v_server); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_write_status( s, GRPC_STATUS_UNIMPLEMENTED, "xyz", tag(5))); diff --git a/test/core/end2end/tests/thread_stress.c b/test/core/end2end/tests/thread_stress.c index 3b571ebd08..8fdb765951 100644 --- a/test/core/end2end/tests/thread_stress.c +++ b/test/core/end2end/tests/thread_stress.c @@ -56,7 +56,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { return n_seconds_time(5); } +static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } /* Drain pending events on a completion queue until it's ready to destroy. Does some post-processing to safely release memory on some of the events. */ @@ -105,7 +105,7 @@ static void drain_cq(int client, grpc_completion_queue *cq) { } /* Kick off a new request - assumes g_mu taken */ -static void start_request() { +static void start_request(void) { gpr_slice slice = gpr_slice_malloc(100); grpc_byte_buffer *buf; grpc_call *call = grpc_channel_create_call( @@ -176,7 +176,7 @@ static void client_thread(void *p) { /* Request a new server call. We tag them with a ref-count that starts at two, and decrements after each of: a read completes and a write completes. When it drops to zero, we write status */ -static void request_server_call() { +static void request_server_call(void) { gpr_refcount *rc = gpr_malloc(sizeof(gpr_refcount)); gpr_ref_init(rc, 2); grpc_server_request_call(g_fixture.server, rc); @@ -214,9 +214,11 @@ static void server_thread(void *p) { break; case GRPC_SERVER_RPC_NEW: if (ev->call) { - GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(ev->call, - g_fixture.server_cq, - ev->tag, 0)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_accept(ev->call, g_fixture.server_cq, + ev->tag)); + GPR_ASSERT(GRPC_CALL_OK == + grpc_call_server_end_initial_metadata(ev->call, 0)); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_read(ev->call, ev->tag)); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_write(ev->call, buf, ev->tag, 0)); diff --git a/test/core/end2end/tests/writes_done_hangs_with_pending_read.c b/test/core/end2end/tests/writes_done_hangs_with_pending_read.c index d959111e43..eea459459a 100644 --- a/test/core/end2end/tests/writes_done_hangs_with_pending_read.c +++ b/test/core/end2end/tests/writes_done_hangs_with_pending_read.c @@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) { return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n)); } -static gpr_timespec five_seconds_time() { 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) { grpc_event *ev; @@ -143,7 +143,8 @@ static void test_writes_done_hangs_with_pending_read( deadline, NULL); cq_verify(v_server); - grpc_call_accept(s, f.server_cq, tag(102), 0); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); cq_expect_client_metadata_read(v_client, tag(2), NULL); cq_verify(v_client); diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 0e21a06401..7eb195811b 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -50,9 +50,9 @@ static grpc_channel *channel; static grpc_completion_queue *cq; static grpc_call *call; -static void init_ping_pong_request() {} +static void init_ping_pong_request(void) {} -static void step_ping_pong_request() { +static void step_ping_pong_request(void) { call = grpc_channel_create_call(channel, "/Reflector/reflectUnary", "localhost", gpr_inf_future); GPR_ASSERT(grpc_call_invoke(call, cq, (void *)1, (void *)1, @@ -69,7 +69,7 @@ static void step_ping_pong_request() { call = NULL; } -static void init_ping_pong_stream() { +static void init_ping_pong_stream(void) { call = grpc_channel_create_call(channel, "/Reflector/reflectStream", "localhost", gpr_inf_future); GPR_ASSERT(grpc_call_invoke(call, cq, (void *)1, (void *)1, 0) == @@ -77,7 +77,7 @@ static void init_ping_pong_stream() { grpc_event_finish(grpc_completion_queue_next(cq, gpr_inf_future)); } -static void step_ping_pong_stream() { +static void step_ping_pong_stream(void) { GPR_ASSERT(grpc_call_start_write(call, the_buffer, (void *)1, 0) == GRPC_CALL_OK); GPR_ASSERT(grpc_call_start_read(call, (void *)1) == GRPC_CALL_OK); @@ -85,7 +85,7 @@ static void step_ping_pong_stream() { grpc_event_finish(grpc_completion_queue_next(cq, gpr_inf_future)); } -static double now() { +static double now(void) { gpr_timespec tv = gpr_now(); return 1e9 * tv.tv_sec + tv.tv_nsec; } diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 44dc33a461..705ab3aca2 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -57,7 +57,7 @@ typedef struct { gpr_uint32 flags; } call_state; -static void request_call() { +static void request_call(void) { call_state *s = gpr_malloc(sizeof(call_state)); gpr_ref_init(&s->pending_ops, 2); grpc_server_request_call(server, s); @@ -130,7 +130,8 @@ int main(int argc, char **argv) { } else { s->flags = GRPC_WRITE_BUFFER_HINT; } - grpc_call_accept(ev->call, cq, s, s->flags); + grpc_call_server_accept(ev->call, cq, s); + grpc_call_server_end_initial_metadata(ev->call, s->flags); GPR_ASSERT(grpc_call_start_read(ev->call, s) == GRPC_CALL_OK); request_call(); } else { diff --git a/test/core/httpcli/format_request_test.c b/test/core/httpcli/format_request_test.c index abda24b44b..ec66f96004 100644 --- a/test/core/httpcli/format_request_test.c +++ b/test/core/httpcli/format_request_test.c @@ -38,7 +38,7 @@ #include <grpc/support/log.h> #include "test/core/util/test_config.h" -static void test_format_get_request() { +static void test_format_get_request(void) { grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; gpr_slice slice; @@ -63,7 +63,7 @@ static void test_format_get_request() { gpr_slice_unref(slice); } -static void test_format_post_request() { +static void test_format_post_request(void) { grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; gpr_slice slice; @@ -93,7 +93,7 @@ static void test_format_post_request() { gpr_slice_unref(slice); } -static void test_format_post_request_no_body() { +static void test_format_post_request_no_body(void) { grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_httpcli_request req; gpr_slice slice; @@ -118,7 +118,7 @@ static void test_format_post_request_no_body() { gpr_slice_unref(slice); } -static void test_format_post_request_content_type_override() { +static void test_format_post_request_content_type_override(void) { grpc_httpcli_header hdrs[2]; grpc_httpcli_request req; gpr_slice slice; diff --git a/test/core/iomgr/alarm_heap_test.c b/test/core/iomgr/alarm_heap_test.c index eaaaf156f4..abb1086a22 100644 --- a/test/core/iomgr/alarm_heap_test.c +++ b/test/core/iomgr/alarm_heap_test.c @@ -40,7 +40,7 @@ #include <grpc/support/log.h> #include "test/core/util/test_config.h" -static gpr_timespec random_deadline() { +static gpr_timespec random_deadline(void) { gpr_timespec ts; ts.tv_sec = rand(); ts.tv_nsec = rand(); @@ -150,7 +150,7 @@ static void check_valid(grpc_alarm_heap *pq) { } } -static void test1() { +static void test1(void) { grpc_alarm_heap pq; const int num_test_elements = 200; const int num_test_operations = 10000; @@ -206,7 +206,7 @@ static void test1() { gpr_free(inpq); } -static void shrink_test() { +static void shrink_test(void) { grpc_alarm_heap pq; int i; int expected_size; diff --git a/test/core/iomgr/alarm_list_test.c b/test/core/iomgr/alarm_list_test.c index 686d21d705..a250951231 100644 --- a/test/core/iomgr/alarm_list_test.c +++ b/test/core/iomgr/alarm_list_test.c @@ -44,13 +44,13 @@ static int cb_called[MAX_CB][2]; static int kicks; -void grpc_kick_poller() { ++kicks; } +void grpc_kick_poller(void) { ++kicks; } static void cb(void *arg, int success) { cb_called[(gpr_intptr)arg][success]++; } -static void add_test() { +static void add_test(void) { gpr_timespec start = gpr_now(); int i; grpc_alarm alarms[20]; @@ -108,7 +108,7 @@ static void add_test() { } /* Cleaning up a list with pending alarms. */ -void destruction_test() { +void destruction_test(void) { grpc_alarm alarms[5]; grpc_alarm_list_init(gpr_time_0); diff --git a/test/core/iomgr/alarm_test.c b/test/core/iomgr/alarm_test.c index 247320de04..aec3a50efc 100644 --- a/test/core/iomgr/alarm_test.c +++ b/test/core/iomgr/alarm_test.c @@ -89,7 +89,7 @@ static void alarm_cb(void *arg /* alarm_arg */, int success) { } /* Test grpc_alarm add and cancel. */ -static void test_grpc_alarm() { +static void test_grpc_alarm(void) { grpc_alarm alarm; grpc_alarm alarm_to_cancel; /* Timeout on the alarm cond. var, so make big enough to absorb time diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index 325c9f0221..136f34a8b0 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -349,7 +349,7 @@ static void client_wait_and_shutdown(client *cl) { /* Test grpc_fd. Start an upload server and client, upload a stream of bytes from the client to the server, and verify that the total number of sent bytes is equal to the total number of received bytes. */ -static void test_grpc_fd() { +static void test_grpc_fd(void) { server sv; client cl; int port; @@ -403,7 +403,7 @@ static void second_read_callback(void *arg /* fd_change_data */, int success) { Note that we have two different but almost identical callbacks above -- the point is to have two different function pointers and two different data pointers and make sure that changing both really works. */ -static void test_grpc_fd_change() { +static void test_grpc_fd_change(void) { grpc_fd *em_fd; fd_change_data a, b; int flags; diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index 99e3119581..26a4bc67e6 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -37,7 +37,7 @@ #include <grpc/support/time.h> #include "test/core/util/test_config.h" -static gpr_timespec test_deadline() { +static gpr_timespec test_deadline(void) { return gpr_time_add(gpr_now(), gpr_time_from_micros(100000000)); } @@ -53,35 +53,35 @@ static void must_fail(void* evp, grpc_resolved_addresses* p) { gpr_event_set(evp, (void*)1); } -static void test_localhost() { +static void test_localhost(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost:1", NULL, must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_default_port() { +static void test_default_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost", "1", must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_missing_default_port() { +static void test_missing_default_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost", NULL, must_fail, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_ipv6_with_port() { +static void test_ipv6_with_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("[2001:db8::1]:1", NULL, must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_ipv6_without_port() { +static void test_ipv6_without_port(void) { const char* const kCases[] = { "2001:db8::1", "2001:db8::1.2.3.4", "[2001:db8::1]", }; @@ -94,7 +94,7 @@ static void test_ipv6_without_port() { } } -static void test_invalid_ip_addresses() { +static void test_invalid_ip_addresses(void) { const char* const kCases[] = { "293.283.1238.3:1", "[2001:db8::11111]:1", }; @@ -107,7 +107,7 @@ static void test_invalid_ip_addresses() { } } -static void test_unparseable_hostports() { +static void test_unparseable_hostports(void) { const char* const kCases[] = { "[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1", }; diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c index 8cd9fb660f..14018ed66c 100644 --- a/test/core/iomgr/sockaddr_utils_test.c +++ b/test/core/iomgr/sockaddr_utils_test.c @@ -70,7 +70,7 @@ static const gpr_uint8 kIPv4[] = {192, 0, 2, 1}; static const gpr_uint8 kIPv6[] = {0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; -static void test_sockaddr_is_v4mapped() { +static void test_sockaddr_is_v4mapped(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr_in output4; @@ -101,7 +101,7 @@ static void test_sockaddr_is_v4mapped() { !grpc_sockaddr_is_v4mapped((const struct sockaddr *)&input4, NULL)); } -static void test_sockaddr_to_v4mapped() { +static void test_sockaddr_to_v4mapped(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr_in6 output6; @@ -129,7 +129,7 @@ static void test_sockaddr_to_v4mapped() { !grpc_sockaddr_to_v4mapped((const struct sockaddr *)&input6, &output6)); } -static void test_sockaddr_is_wildcard() { +static void test_sockaddr_is_wildcard(void) { struct sockaddr_in wild4; struct sockaddr_in6 wild6; struct sockaddr_in6 wild_mapped; @@ -187,7 +187,7 @@ static void expect_sockaddr_str(const char *expected, void *addr, gpr_free(str); } -static void test_sockaddr_to_string() { +static void test_sockaddr_to_string(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr dummy; diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 2d0a89a1f5..79ba777e85 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -43,7 +43,7 @@ #include <grpc/support/log.h> #include <grpc/support/time.h> -static gpr_timespec test_deadline() { +static gpr_timespec test_deadline(void) { return gpr_time_add(gpr_now(), gpr_time_from_seconds(10)); } @@ -59,7 +59,7 @@ static void must_fail(void *arg, grpc_endpoint *tcp) { gpr_event_set(arg, (void *)1); } -void test_succeeds() { +void test_succeeds(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); int svr_fd; @@ -94,7 +94,7 @@ void test_succeeds() { GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -void test_fails() { +void test_fails(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); gpr_event ev; @@ -112,7 +112,7 @@ void test_fails() { GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -void test_times_out() { +void test_times_out(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); int svr_fd; diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 6af3ded98b..182ccba3f6 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -444,7 +444,7 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) { free(slices); } -void run_tests() { +void run_tests(void) { int i = 0; read_test(100, 8192); @@ -469,7 +469,7 @@ void run_tests() { } } -static void clean_up() {} +static void clean_up(void) {} static grpc_endpoint_test_fixture create_fixture_tcp_socketpair( size_t slice_size) { diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index f30ff917cb..e906f302cf 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -58,19 +58,19 @@ static void on_connect(void *arg, grpc_endpoint *tcp) { gpr_mu_unlock(&mu); } -static void test_no_op() { +static void test_no_op(void) { grpc_tcp_server *s = grpc_tcp_server_create(); grpc_tcp_server_destroy(s); } -static void test_no_op_with_start() { +static void test_no_op_with_start(void) { grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); grpc_tcp_server_start(s, NULL, on_connect, NULL); grpc_tcp_server_destroy(s); } -static void test_no_op_with_port() { +static void test_no_op_with_port(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); @@ -83,7 +83,7 @@ static void test_no_op_with_port() { grpc_tcp_server_destroy(s); } -static void test_no_op_with_port_and_start() { +static void test_no_op_with_port_and_start(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); diff --git a/test/core/iomgr/time_averaged_stats_test.c b/test/core/iomgr/time_averaged_stats_test.c index 7ed2f84f21..bbfeab5633 100644 --- a/test/core/iomgr/time_averaged_stats_test.c +++ b/test/core/iomgr/time_averaged_stats_test.c @@ -41,7 +41,7 @@ #define EXPECT_EQ(a, b) GPR_ASSERT((a) == (b)) #define EXPECT_DOUBLE_EQ(a, b) GPR_ASSERT(fabs((a) - (b)) < 1e-9) -static void no_regress_no_persist_test_1() { +static void no_regress_no_persist_test_1(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -59,7 +59,7 @@ static void no_regress_no_persist_test_1() { EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight); } -static void no_regress_no_persist_test_2() { +static void no_regress_no_persist_test_2(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -75,7 +75,7 @@ static void no_regress_no_persist_test_2() { EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight); } -static void no_regress_no_persist_test_3() { +static void no_regress_no_persist_test_3(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -92,7 +92,7 @@ static void no_regress_no_persist_test_3() { EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight); } -static void some_regress_no_persist_test() { +static void some_regress_no_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0.5, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -105,7 +105,7 @@ static void some_regress_no_persist_test() { EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight); } -static void some_decay_test() { +static void some_decay_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 1, 0.0); EXPECT_EQ(1000, tas.aggregate_weighted_avg); @@ -126,7 +126,7 @@ static void some_decay_test() { EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight); } -static void no_regress_full_persist_test() { +static void no_regress_full_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 1.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -146,7 +146,7 @@ static void no_regress_full_persist_test() { EXPECT_DOUBLE_EQ(3, tas.aggregate_total_weight); } -static void no_regress_some_persist_test() { +static void no_regress_some_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.5); /* Should replace init value */ @@ -162,7 +162,7 @@ static void no_regress_some_persist_test() { EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight); } -static void some_regress_some_persist_test() { +static void some_regress_some_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0.4, 0.6); /* Sample weight = 0 */ diff --git a/test/core/network_benchmarks/low_level_ping_pong.c b/test/core/network_benchmarks/low_level_ping_pong.c index 8a4c1befb6..9a6f518399 100644 --- a/test/core/network_benchmarks/low_level_ping_pong.c +++ b/test/core/network_benchmarks/low_level_ping_pong.c @@ -293,7 +293,7 @@ static void print_histogram(gpr_histogram *histogram) { gpr_histogram_percentile(histogram, 99.9)); } -static double now() { +static double now(void) { gpr_timespec tv = gpr_now(); return 1e9 * tv.tv_sec + tv.tv_nsec; } diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c index d4baa64725..2e23b6a2cd 100644 --- a/test/core/security/secure_endpoint_test.c +++ b/test/core/security/secure_endpoint_test.c @@ -125,7 +125,7 @@ secure_endpoint_create_fixture_tcp_socketpair_leftover(size_t slice_size) { return f; } -static void clean_up() {} +static void clean_up(void) {} static grpc_endpoint_test_config configs[] = { {"secure_ep/tcp_socketpair", diff --git a/test/core/statistics/census_log_tests.c b/test/core/statistics/census_log_tests.c index 44ad4b9358..6a3c8adcc5 100644 --- a/test/core/statistics/census_log_tests.c +++ b/test/core/statistics/census_log_tests.c @@ -114,7 +114,7 @@ static size_t perform_read_iteration(size_t record_size) { } /* Asserts that the log is empty. */ -static void assert_log_empty() { +static void assert_log_empty(void) { size_t bytes_available; census_log_init_reader(); GPR_ASSERT(census_log_read_next(&bytes_available) == NULL); @@ -345,7 +345,7 @@ static void setup_test(int circular_log) { /* Attempts to create a record of invalid size (size > CENSUS_LOG_MAX_RECORD_SIZE). */ -void test_invalid_record_size() { +void test_invalid_record_size(void) { static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1; static const size_t VALID_SIZE = 1; void* record; @@ -368,7 +368,7 @@ void test_invalid_record_size() { /* Tests end_write() with a different size than what was specified in start_write(). */ -void test_end_write_with_different_size() { +void test_end_write_with_different_size(void) { static const size_t START_WRITE_SIZE = 10; static const size_t END_WRITE_SIZE = 7; void* record_written; @@ -388,7 +388,7 @@ void test_end_write_with_different_size() { } /* Verifies that pending records are not available via read_next(). */ -void test_read_pending_record() { +void test_read_pending_record(void) { static const size_t PR_RECORD_SIZE = 1024; size_t bytes_available; const void* record_read; @@ -413,7 +413,7 @@ void test_read_pending_record() { } /* Tries reading beyond pending write. */ -void test_read_beyond_pending_record() { +void test_read_beyond_pending_record(void) { /* Start a write. */ gpr_int32 incomplete_record_size = 10; gpr_int32 complete_record_size = 20; @@ -452,7 +452,7 @@ void test_read_beyond_pending_record() { /* Tests scenario where block being read is detached from a core and put on the dirty list. */ -void test_detached_while_reading() { +void test_detached_while_reading(void) { static const size_t DWR_RECORD_SIZE = 10; size_t bytes_available; const void* record_read; @@ -488,7 +488,7 @@ void test_detached_while_reading() { /* Fills non-circular log with records sized such that size is a multiple of CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */ -void test_fill_log_no_fragmentation() { +void test_fill_log_no_fragmentation(void) { const int circular = 0; printf("Starting test: fill log no fragmentation\n"); setup_test(circular); @@ -498,7 +498,7 @@ void test_fill_log_no_fragmentation() { /* Fills circular log with records sized such that size is a multiple of CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */ -void test_fill_circular_log_no_fragmentation() { +void test_fill_circular_log_no_fragmentation(void) { const int circular = 1; printf("Starting test: fill circular log no fragmentation\n"); setup_test(circular); @@ -507,7 +507,7 @@ void test_fill_circular_log_no_fragmentation() { } /* Fills non-circular log with records that may straddle end of a block. */ -void test_fill_log_with_straddling_records() { +void test_fill_log_with_straddling_records(void) { const int circular = 0; printf("Starting test: fill log with straddling records\n"); setup_test(circular); @@ -516,7 +516,7 @@ void test_fill_log_with_straddling_records() { } /* Fills circular log with records that may straddle end of a block. */ -void test_fill_circular_log_with_straddling_records() { +void test_fill_circular_log_with_straddling_records(void) { const int circular = 1; printf("Starting test: fill circular log with straddling records\n"); setup_test(circular); @@ -526,7 +526,7 @@ void test_fill_circular_log_with_straddling_records() { /* Tests scenario where multiple writers and a single reader are using a log that is configured to discard old records. */ -void test_multiple_writers_circular_log() { +void test_multiple_writers_circular_log(void) { const int circular = 1; printf("Starting test: multiple writers circular log\n"); setup_test(circular); @@ -536,7 +536,7 @@ void test_multiple_writers_circular_log() { /* Tests scenario where multiple writers and a single reader are using a log that is configured to discard old records. */ -void test_multiple_writers() { +void test_multiple_writers(void) { const int circular = 0; printf("Starting test: multiple writers\n"); setup_test(circular); @@ -545,7 +545,7 @@ void test_multiple_writers() { } /* Repeat the straddling records and multiple writers tests with a small log. */ -void test_small_log() { +void test_small_log(void) { size_t log_size; const int circular = 0; printf("Starting test: small log\n"); @@ -559,7 +559,7 @@ void test_small_log() { census_log_shutdown(); } -void test_performance() { +void test_performance(void) { int write_size = 1; for (; write_size < CENSUS_LOG_MAX_RECORD_SIZE; write_size *= 2) { gpr_timespec write_time; diff --git a/test/core/statistics/census_stub_test.c b/test/core/statistics/census_stub_test.c index a86676fbb1..c651eaf21f 100644 --- a/test/core/statistics/census_stub_test.c +++ b/test/core/statistics/census_stub_test.c @@ -41,7 +41,7 @@ #include "test/core/util/test_config.h" /* Tests census noop stubs in a simulated rpc flow */ -void test_census_stubs() { +void test_census_stubs(void) { census_op_id op_id; census_rpc_stats* stats = census_rpc_stats_create_empty(); census_aggregated_rpc_stats data_map = {0, NULL}; diff --git a/test/core/statistics/hash_table_test.c b/test/core/statistics/hash_table_test.c index 8c76824193..5d05ab5bc4 100644 --- a/test/core/statistics/hash_table_test.c +++ b/test/core/statistics/hash_table_test.c @@ -61,7 +61,7 @@ static gpr_uint64 force_collision(const void* k) { static void free_data(void* data) { gpr_free(data); } /* Basic tests that empty hash table can be created and destroyed. */ -static void test_create_table() { +static void test_create_table(void) { /* Create table with uint64 key type */ census_ht* ht = NULL; census_ht_option ht_options = {CENSUS_HT_UINT64, 1999, NULL, NULL, NULL, @@ -81,7 +81,7 @@ static void test_create_table() { census_ht_destroy(ht); } -static void test_table_with_int_key() { +static void test_table_with_int_key(void) { census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL}; census_ht* ht = census_ht_create(&opt); gpr_uint64 i = 0; @@ -118,7 +118,7 @@ static void test_table_with_int_key() { } /* Test that there is no memory leak when keys and values are owned by table. */ -static void test_value_and_key_deleter() { +static void test_value_and_key_deleter(void) { census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys, &free_data, &free_data}; census_ht* ht = census_ht_create(&opt); @@ -148,7 +148,7 @@ static void test_value_and_key_deleter() { } /* Test simple insert and erase operations. */ -static void test_simple_add_and_erase() { +static void test_simple_add_and_erase(void) { census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL}; census_ht* ht = census_ht_create(&opt); GPR_ASSERT(ht != NULL); @@ -183,7 +183,7 @@ static void test_simple_add_and_erase() { census_ht_destroy(ht); } -static void test_insertion_and_deletion_with_high_collision_rate() { +static void test_insertion_and_deletion_with_high_collision_rate(void) { census_ht_option opt = {CENSUS_HT_POINTER, 13, &force_collision, &cmp_str_keys, NULL, NULL}; census_ht* ht = census_ht_create(&opt); @@ -207,7 +207,7 @@ static void test_insertion_and_deletion_with_high_collision_rate() { census_ht_destroy(ht); } -static void test_table_with_string_key() { +static void test_table_with_string_key(void) { census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys, NULL, NULL}; census_ht* ht = census_ht_create(&opt); @@ -258,7 +258,7 @@ static void test_table_with_string_key() { census_ht_destroy(ht); } -static void test_insertion_with_same_key() { +static void test_insertion_with_same_key(void) { census_ht_option opt = {CENSUS_HT_UINT64, 11, NULL, NULL, NULL, NULL}; census_ht* ht = census_ht_create(&opt); census_ht_key key; diff --git a/test/core/statistics/rpc_stats_test.c b/test/core/statistics/rpc_stats_test.c index c101403450..1e929d18ef 100644 --- a/test/core/statistics/rpc_stats_test.c +++ b/test/core/statistics/rpc_stats_test.c @@ -45,7 +45,7 @@ #include "test/core/util/test_config.h" /* Ensure all possible state transitions are called without causing problem */ -static void test_init_shutdown() { +static void test_init_shutdown(void) { census_stats_store_init(); census_stats_store_init(); census_stats_store_shutdown(); @@ -53,7 +53,7 @@ static void test_init_shutdown() { census_stats_store_init(); } -static void test_create_and_destroy() { +static void test_create_and_destroy(void) { census_rpc_stats* stats = NULL; census_aggregated_rpc_stats agg_stats = {0, NULL}; @@ -80,7 +80,7 @@ static void test_create_and_destroy() { #define ASSERT_NEAR(a, b) \ GPR_ASSERT((a - b) * (a - b) < 1e-24 * (a + b) * (a + b)) -static void test_record_and_get_stats() { +static void test_record_and_get_stats(void) { census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4}; census_op_id id; census_aggregated_rpc_stats agg_stats = {0, NULL}; @@ -149,7 +149,7 @@ static void test_record_and_get_stats() { census_shutdown(); } -static void test_record_stats_on_unknown_op_id() { +static void test_record_stats_on_unknown_op_id(void) { census_op_id unknown_id = {0xDEAD, 0xBEEF}; census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4}; census_aggregated_rpc_stats agg_stats = {0, NULL}; @@ -169,7 +169,7 @@ static void test_record_stats_on_unknown_op_id() { } /* Test that record stats is noop when trace store is uninitialized. */ -static void test_record_stats_with_trace_store_uninitialized() { +static void test_record_stats_with_trace_store_uninitialized(void) { census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4}; census_op_id id = {0, 0}; census_aggregated_rpc_stats agg_stats = {0, NULL}; diff --git a/test/core/statistics/trace_test.c b/test/core/statistics/trace_test.c index 9a6c54b90f..6eafcf1456 100644 --- a/test/core/statistics/trace_test.c +++ b/test/core/statistics/trace_test.c @@ -45,7 +45,7 @@ #include "test/core/util/test_config.h" /* Ensure all possible state transitions are called without causing problem */ -static void test_init_shutdown() { +static void test_init_shutdown(void) { census_tracing_init(); census_tracing_init(); census_tracing_shutdown(); @@ -53,7 +53,7 @@ static void test_init_shutdown() { census_tracing_init(); } -static void test_start_op_generates_locally_unique_ids() { +static void test_start_op_generates_locally_unique_ids(void) { /* Check that ids generated within window size of 1000 are unique. TODO(hongyu): Replace O(n^2) duplicate detection algorithm with O(nlogn) algorithm. Enhance the test to larger window size (>10^6) */ @@ -75,7 +75,7 @@ static void test_start_op_generates_locally_unique_ids() { census_shutdown(); } -static void test_get_trace_method_name() { +static void test_get_trace_method_name(void) { census_op_id id; const char write_name[] = "service/method"; census_tracing_init(); @@ -119,7 +119,7 @@ static void mimic_trace_op_sequences(void* arg) { gpr_mu_unlock(&args->mu); } -static void test_concurrency() { +static void test_concurrency(void) { #define NUM_THREADS 1000 gpr_thd_id tid[NUM_THREADS]; int i = 0; @@ -141,7 +141,7 @@ static void test_concurrency() { #undef NUM_THREADS } -static void test_add_method_tag_to_unknown_op_id() { +static void test_add_method_tag_to_unknown_op_id(void) { census_op_id unknown_id = {0xDEAD, 0xBEEF}; int ret = 0; census_tracing_init(); @@ -150,7 +150,7 @@ static void test_add_method_tag_to_unknown_op_id() { census_tracing_shutdown(); } -static void test_trace_print() { +static void test_trace_print(void) { census_op_id id; int i; const char* annotation_txt[4] = {"abc", "", "$%^ *()_"}; diff --git a/test/core/statistics/window_stats_test.c b/test/core/statistics/window_stats_test.c index 2bf93d8c87..1fe7747740 100644 --- a/test/core/statistics/window_stats_test.c +++ b/test/core/statistics/window_stats_test.c @@ -73,7 +73,7 @@ static int compare_double(double a, double b, double epsilon) { } } -void empty_test() { +void empty_test(void) { census_window_stats_sums result; const gpr_timespec zero = {0, 0}; test_stat sum; @@ -88,7 +88,7 @@ void empty_test() { census_window_stats_destroy(stats); } -void one_interval_test() { +void one_interval_test(void) { const test_stat value = {0.1, 4}; const double epsilon = 1e10 - 11; gpr_timespec when = {0, 0}; @@ -197,7 +197,7 @@ void one_interval_test() { census_window_stats_destroy(stats); } -void many_interval_test() { +void many_interval_test(void) { gpr_timespec intervals[4]; const test_stat value = {123.45, 8}; const double epsilon = 1e10 - 11; @@ -258,7 +258,7 @@ void many_interval_test() { census_window_stats_destroy(stats); } -void rolling_time_test() { +void rolling_time_test(void) { const test_stat value = {0.1, 4}; gpr_timespec when = {0, 0}; census_window_stats_sums result; @@ -282,7 +282,7 @@ void rolling_time_test() { census_window_stats_destroy(stats); } #include <stdio.h> -void infinite_interval_test() { +void infinite_interval_test(void) { const test_stat value = {0.1, 4}; gpr_timespec when = {0, 0}; census_window_stats_sums result; diff --git a/test/core/support/cmdline_test.c b/test/core/support/cmdline_test.c index 91035a662b..1d15c66289 100644 --- a/test/core/support/cmdline_test.c +++ b/test/core/support/cmdline_test.c @@ -41,7 +41,7 @@ #define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) -static void test_simple_int() { +static void test_simple_int(void) { int x = 1; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; @@ -56,7 +56,7 @@ static void test_simple_int() { gpr_cmdline_destroy(cl); } -static void test_eq_int() { +static void test_eq_int(void) { int x = 1; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "-foo=3"}; @@ -71,7 +71,7 @@ static void test_eq_int() { gpr_cmdline_destroy(cl); } -static void test_2dash_int() { +static void test_2dash_int(void) { int x = 1; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; @@ -86,7 +86,7 @@ static void test_2dash_int() { gpr_cmdline_destroy(cl); } -static void test_2dash_eq_int() { +static void test_2dash_eq_int(void) { int x = 1; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=3"}; @@ -101,7 +101,7 @@ static void test_2dash_eq_int() { gpr_cmdline_destroy(cl); } -static void test_simple_string() { +static void test_simple_string(void) { char *x = NULL; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; @@ -116,7 +116,7 @@ static void test_simple_string() { gpr_cmdline_destroy(cl); } -static void test_eq_string() { +static void test_eq_string(void) { char *x = NULL; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "-foo=3"}; @@ -131,7 +131,7 @@ static void test_eq_string() { gpr_cmdline_destroy(cl); } -static void test_2dash_string() { +static void test_2dash_string(void) { char *x = NULL; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; @@ -146,7 +146,7 @@ static void test_2dash_string() { gpr_cmdline_destroy(cl); } -static void test_2dash_eq_string() { +static void test_2dash_eq_string(void) { char *x = NULL; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=3"}; @@ -161,7 +161,7 @@ static void test_2dash_eq_string() { gpr_cmdline_destroy(cl); } -static void test_flag_on() { +static void test_flag_on(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo"}; @@ -176,7 +176,7 @@ static void test_flag_on() { gpr_cmdline_destroy(cl); } -static void test_flag_no() { +static void test_flag_no(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--no-foo"}; @@ -191,7 +191,7 @@ static void test_flag_no() { gpr_cmdline_destroy(cl); } -static void test_flag_val_1() { +static void test_flag_val_1(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=1"}; @@ -206,7 +206,7 @@ static void test_flag_val_1() { gpr_cmdline_destroy(cl); } -static void test_flag_val_0() { +static void test_flag_val_0(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=0"}; @@ -221,7 +221,7 @@ static void test_flag_val_0() { gpr_cmdline_destroy(cl); } -static void test_flag_val_true() { +static void test_flag_val_true(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=true"}; @@ -236,7 +236,7 @@ static void test_flag_val_true() { gpr_cmdline_destroy(cl); } -static void test_flag_val_false() { +static void test_flag_val_false(void) { int x = 2; gpr_cmdline *cl; char *args[] = {(char *)__FUNCTION__, "--foo=false"}; @@ -251,7 +251,7 @@ static void test_flag_val_false() { gpr_cmdline_destroy(cl); } -static void test_many() { +static void test_many(void) { char *str = NULL; int x = 0; int flag = 2; diff --git a/test/core/support/histogram_test.c b/test/core/support/histogram_test.c index 3b5fd73047..4769ce0599 100644 --- a/test/core/support/histogram_test.c +++ b/test/core/support/histogram_test.c @@ -36,7 +36,7 @@ #define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__); -static void test_no_op() { +static void test_no_op(void) { gpr_histogram_destroy(gpr_histogram_create(0.01, 60e9)); } @@ -49,7 +49,7 @@ static void expect_percentile(gpr_histogram *h, double percentile, GPR_ASSERT(got <= max_expect); } -static void test_simple() { +static void test_simple(void) { gpr_histogram *h; LOG_TEST(); @@ -66,7 +66,7 @@ static void test_simple() { gpr_histogram_destroy(h); } -static void test_percentile() { +static void test_percentile(void) { gpr_histogram *h; double last; double i; @@ -111,7 +111,7 @@ static void test_percentile() { gpr_histogram_destroy(h); } -static void test_merge() { +static void test_merge(void) { gpr_histogram *h1, *h2; double last; double i; diff --git a/test/core/support/host_port_test.c b/test/core/support/host_port_test.c index d1553c514e..5b06b7076e 100644 --- a/test/core/support/host_port_test.c +++ b/test/core/support/host_port_test.c @@ -48,7 +48,7 @@ static void join_host_port_expect(const char *host, int port, gpr_free(buf); } -static void test_join_host_port() { +static void test_join_host_port(void) { join_host_port_expect("foo", 101, "foo:101"); join_host_port_expect("", 102, ":102"); join_host_port_expect("1::2", 103, "[1::2]:103"); @@ -56,7 +56,7 @@ static void test_join_host_port() { } /* Garbage in, garbage out. */ -static void test_join_host_port_garbage() { +static void test_join_host_port_garbage(void) { join_host_port_expect("[foo]", 105, "[foo]:105"); join_host_port_expect("[::", 106, "[:::106"); join_host_port_expect("::]", 107, "[::]]:107"); diff --git a/test/core/support/slice_test.c b/test/core/support/slice_test.c index 40440344c0..2a7056feb2 100644 --- a/test/core/support/slice_test.c +++ b/test/core/support/slice_test.c @@ -40,7 +40,7 @@ #define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__); -static void test_slice_malloc_returns_something_sensible() { +static void test_slice_malloc_returns_something_sensible(void) { /* Calls gpr_slice_create for various lengths and verifies the internals for consistency. */ size_t length; @@ -74,7 +74,7 @@ static void test_slice_malloc_returns_something_sensible() { static void do_nothing(void *ignored) {} -static void test_slice_new_returns_something_sensible() { +static void test_slice_new_returns_something_sensible(void) { gpr_uint8 x; gpr_slice slice = gpr_slice_new(&x, 1, do_nothing); @@ -91,7 +91,7 @@ static void do_nothing_with_len_1(void *ignored, size_t len) { do_nothing_with_len_1_calls++; } -static void test_slice_new_with_len_returns_something_sensible() { +static void test_slice_new_with_len_returns_something_sensible(void) { gpr_uint8 x; gpr_slice slice = gpr_slice_new_with_len(&x, 1, do_nothing_with_len_1); @@ -198,7 +198,7 @@ static void test_slice_split_tail_works(int length) { gpr_slice_unref(slice); } -static void test_slice_from_copied_string_works() { +static void test_slice_from_copied_string_works(void) { static const char *text = "HELLO WORLD!"; gpr_slice slice; diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c index 22ae7bacf5..e87a606aba 100644 --- a/test/core/support/string_test.c +++ b/test/core/support/string_test.c @@ -44,7 +44,7 @@ #define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__) -static void test_strdup() { +static void test_strdup(void) { static const char *src1 = "hello world"; char *dst1; @@ -64,7 +64,7 @@ static void expect_hexdump(const char *buf, size_t len, gpr_uint32 flags, gpr_free(got); } -static void test_hexdump() { +static void test_hexdump(void) { LOG_TEST_NAME(); expect_hexdump("\x01", 1, 0, "01"); expect_hexdump("\x01", 1, GPR_HEXDUMP_PLAINTEXT, "01 '.'"); @@ -85,7 +85,7 @@ static void test_pu32_succeed(const char *s, gpr_uint32 want) { GPR_ASSERT(out == want); } -static void test_parse_uint32() { +static void test_parse_uint32(void) { LOG_TEST_NAME(); test_pu32_fail("-1"); @@ -119,7 +119,7 @@ static void test_parse_uint32() { test_pu32_fail("4294967299"); } -static void test_asprintf() { +static void test_asprintf(void) { char *buf; int i, j; diff --git a/test/core/support/time_test.c b/test/core/support/time_test.c index d74d6a52d9..56f927787b 100644 --- a/test/core/support/time_test.c +++ b/test/core/support/time_test.c @@ -222,7 +222,7 @@ static void test_sticky_infinities(void) { } } -static void test_similar() { +static void test_similar(void) { GPR_ASSERT(1 == gpr_time_similar(gpr_inf_future, gpr_inf_future, gpr_time_0)); GPR_ASSERT(1 == gpr_time_similar(gpr_inf_past, gpr_inf_past, gpr_time_0)); GPR_ASSERT(0 == gpr_time_similar(gpr_inf_past, gpr_inf_future, gpr_time_0)); diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c index bc5a512a0b..d78dd641ad 100644 --- a/test/core/surface/byte_buffer_reader_test.c +++ b/test/core/surface/byte_buffer_reader_test.c @@ -46,7 +46,7 @@ #define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) -static void test_create() { +static void test_create(void) { grpc_byte_buffer *buffer; grpc_byte_buffer_reader *reader; gpr_slice empty = gpr_empty_slice(); @@ -57,7 +57,7 @@ static void test_create() { grpc_byte_buffer_destroy(buffer); } -static void test_read_one_slice() { +static void test_read_one_slice(void) { gpr_slice slice; grpc_byte_buffer *buffer; grpc_byte_buffer_reader *reader; @@ -79,7 +79,7 @@ static void test_read_one_slice() { grpc_byte_buffer_destroy(buffer); } -static void test_read_one_slice_malloc() { +static void test_read_one_slice_malloc(void) { gpr_slice slice; grpc_byte_buffer *buffer; grpc_byte_buffer_reader *reader; diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 9be2a67d8d..71f9cc2291 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -47,7 +47,7 @@ static void increment_int_on_finish(void *user_data, grpc_op_error error) { ++*(int *)user_data; } -static void *create_test_tag() { +static void *create_test_tag(void) { static gpr_intptr i = 0; return (void *)(++i); } @@ -64,12 +64,12 @@ static void shutdown_and_destroy(grpc_completion_queue *cc) { } /* ensure we can create and destroy a completion channel */ -static void test_no_op() { +static void test_no_op(void) { LOG_TEST(); shutdown_and_destroy(grpc_completion_queue_create()); } -static void test_wait_empty() { +static void test_wait_empty(void) { grpc_completion_queue *cc; LOG_TEST(); @@ -79,7 +79,7 @@ static void test_wait_empty() { shutdown_and_destroy(cc); } -static void test_cq_end_read() { +static void test_cq_end_read(void) { grpc_event *ev; grpc_completion_queue *cc; int on_finish_called = 0; @@ -105,7 +105,7 @@ static void test_cq_end_read() { shutdown_and_destroy(cc); } -static void test_cq_end_invoke_accepted() { +static void test_cq_end_invoke_accepted(void) { grpc_event *ev; grpc_completion_queue *cc; int on_finish_called = 0; @@ -131,7 +131,7 @@ static void test_cq_end_invoke_accepted() { shutdown_and_destroy(cc); } -static void test_cq_end_write_accepted() { +static void test_cq_end_write_accepted(void) { grpc_event *ev; grpc_completion_queue *cc; int on_finish_called = 0; @@ -157,7 +157,7 @@ static void test_cq_end_write_accepted() { shutdown_and_destroy(cc); } -static void test_cq_end_finish_accepted() { +static void test_cq_end_finish_accepted(void) { grpc_event *ev; grpc_completion_queue *cc; int on_finish_called = 0; @@ -183,7 +183,7 @@ static void test_cq_end_finish_accepted() { shutdown_and_destroy(cc); } -static void test_cq_end_client_metadata_read() { +static void test_cq_end_client_metadata_read(void) { grpc_event *ev; grpc_completion_queue *cc; int on_finish_called = 0; @@ -210,7 +210,7 @@ static void test_cq_end_client_metadata_read() { shutdown_and_destroy(cc); } -static void test_pluck() { +static void test_pluck(void) { grpc_event *ev; grpc_completion_queue *cc; void *tags[128]; @@ -273,7 +273,7 @@ typedef struct test_thread_options { grpc_completion_queue *cc; } test_thread_options; -gpr_timespec ten_seconds_time() { +gpr_timespec ten_seconds_time(void) { return gpr_time_add(gpr_now(), gpr_time_from_micros(10 * 1000000)); } diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c index 8810925ba5..1576a30c1b 100644 --- a/test/core/transport/chttp2/hpack_table_test.c +++ b/test/core/transport/chttp2/hpack_table_test.c @@ -54,7 +54,7 @@ static void assert_index(const grpc_chttp2_hptbl *tbl, int idx, const char *key, assert_str(tbl, md->value, value); } -static void test_static_lookup() { +static void test_static_lookup(void) { grpc_chttp2_hptbl tbl; grpc_mdctx *mdctx; @@ -128,7 +128,7 @@ static void test_static_lookup() { grpc_mdctx_orphan(mdctx); } -static void test_many_additions() { +static void test_many_additions(void) { grpc_chttp2_hptbl tbl; int i; char key[32]; @@ -165,7 +165,7 @@ static grpc_chttp2_hptbl_find_result find_simple(grpc_chttp2_hptbl *tbl, return r; } -static void test_find() { +static void test_find(void) { grpc_chttp2_hptbl tbl; int i; char buffer[32]; diff --git a/test/core/transport/chttp2/stream_encoder_test.c b/test/core/transport/chttp2/stream_encoder_test.c index ba552786db..cebc2634fb 100644 --- a/test/core/transport/chttp2/stream_encoder_test.c +++ b/test/core/transport/chttp2/stream_encoder_test.c @@ -102,7 +102,7 @@ static void assert_result_ok(void *user_data, grpc_op_error error) { GPR_ASSERT(error == GRPC_OP_OK); } -static void test_small_data_framing() { +static void test_small_data_framing(void) { grpc_sopb_add_no_op(&g_sopb); verify_sopb(10, 0, 0, ""); @@ -135,7 +135,7 @@ static void add_sopb_header(const char *key, const char *value) { grpc_mdelem_from_strings(g_mdctx, key, value)); } -static void test_basic_headers() { +static void test_basic_headers(void) { int i; add_sopb_header("a", "a"); @@ -183,7 +183,7 @@ static void encode_int_to_str(int i, char *p) { p[2] = 0; } -static void test_decode_table_overflow() { +static void test_decode_table_overflow(void) { int i; char key[3], value[3]; char expect[128]; @@ -281,10 +281,10 @@ static void test_decode_random_headers_inner(int max_len) { grpc_sopb_destroy(&encops); } -#define DECL_TEST_DECODE_RANDOM_HEADERS(n) \ - static void test_decode_random_headers_##n() { \ - test_decode_random_headers_inner(n); \ - } \ +#define DECL_TEST_DECODE_RANDOM_HEADERS(n) \ + static void test_decode_random_headers_##n(void) { \ + test_decode_random_headers_inner(n); \ + } \ int keeps_formatting_correct_##n DECL_TEST_DECODE_RANDOM_HEADERS(1); diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c index 459ef2aede..9b4446f7f8 100644 --- a/test/core/transport/chttp2/stream_map_test.c +++ b/test/core/transport/chttp2/stream_map_test.c @@ -38,7 +38,7 @@ #define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) /* test creation & destruction */ -static void test_no_op() { +static void test_no_op(void) { grpc_chttp2_stream_map map; LOG_TEST(); @@ -48,7 +48,7 @@ static void test_no_op() { } /* test lookup on an empty map */ -static void test_empty_find() { +static void test_empty_find(void) { grpc_chttp2_stream_map map; LOG_TEST(); @@ -59,7 +59,7 @@ static void test_empty_find() { } /* test it's safe to delete twice */ -static void test_double_deletion() { +static void test_double_deletion(void) { grpc_chttp2_stream_map map; LOG_TEST(); diff --git a/test/core/transport/chttp2/timeout_encoding_test.c b/test/core/transport/chttp2/timeout_encoding_test.c index 793d2b945e..4bb84e3f0b 100644 --- a/test/core/transport/chttp2/timeout_encoding_test.c +++ b/test/core/transport/chttp2/timeout_encoding_test.c @@ -49,7 +49,7 @@ static void assert_encodes_as(gpr_timespec ts, const char *s) { GPR_ASSERT(0 == strcmp(buffer, s)); } -void test_encoding() { +void test_encoding(void) { LOG_TEST(); assert_encodes_as(gpr_time_from_micros(-1), "1n"); assert_encodes_as(gpr_time_from_seconds(-10), "1n"); @@ -106,7 +106,7 @@ void decode_suite(char ext, gpr_timespec (*answer)(long x)) { } } -void test_decoding() { +void test_decoding(void) { LOG_TEST(); decode_suite('n', gpr_time_from_nanos); decode_suite('u', gpr_time_from_micros); @@ -117,7 +117,7 @@ void test_decoding() { assert_decodes_as("1000000000000000000000u", gpr_inf_future); } -void test_decoding_fails() { +void test_decoding_fails(void) { gpr_timespec x; LOG_TEST(); GPR_ASSERT(0 == grpc_chttp2_decode_timeout("", &x)); diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index ec424ce144..804096d0e1 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -45,7 +45,7 @@ /* a large number */ #define MANY 1000000 -static void test_no_op() { +static void test_no_op(void) { grpc_mdctx *ctx; LOG_TEST(); @@ -54,7 +54,7 @@ static void test_no_op() { grpc_mdctx_orphan(ctx); } -static void test_create_string() { +static void test_create_string(void) { grpc_mdctx *ctx; grpc_mdstr *s1, *s2, *s3; @@ -74,7 +74,7 @@ static void test_create_string() { grpc_mdstr_unref(s3); } -static void test_create_metadata() { +static void test_create_metadata(void) { grpc_mdctx *ctx; grpc_mdelem *m1, *m2, *m3; @@ -97,7 +97,7 @@ static void test_create_metadata() { grpc_mdctx_orphan(ctx); } -static void test_create_many_ephemeral_metadata() { +static void test_create_many_ephemeral_metadata(void) { grpc_mdctx *ctx; char buffer[256]; long i; @@ -118,7 +118,7 @@ static void test_create_many_ephemeral_metadata() { grpc_mdctx_orphan(ctx); } -static void test_create_many_persistant_metadata() { +static void test_create_many_persistant_metadata(void) { grpc_mdctx *ctx; char buffer[256]; long i; @@ -149,7 +149,7 @@ static void test_create_many_persistant_metadata() { gpr_free(created); } -static void test_spin_creating_the_same_thing() { +static void test_spin_creating_the_same_thing(void) { grpc_mdctx *ctx; LOG_TEST(); @@ -173,7 +173,7 @@ static void test_spin_creating_the_same_thing() { grpc_mdctx_orphan(ctx); } -static void test_things_stick_around() { +static void test_things_stick_around(void) { grpc_mdctx *ctx; int i, j; char buffer[64]; @@ -220,7 +220,7 @@ static void test_things_stick_around() { gpr_free(shuf); } -static void test_slices_work() { +static void test_slices_work(void) { /* ensure no memory leaks when switching representation from mdstr to slice */ grpc_mdctx *ctx; grpc_mdstr *str; @@ -245,7 +245,7 @@ static void test_slices_work() { grpc_mdctx_orphan(ctx); } -static void test_base64_and_huffman_works() { +static void test_base64_and_huffman_works(void) { grpc_mdctx *ctx; grpc_mdstr *str; gpr_slice slice1; diff --git a/test/core/transport/transport_end2end_tests.c b/test/core/transport/transport_end2end_tests.c index 86e987bef0..712081bc8a 100644 --- a/test/core/transport/transport_end2end_tests.c +++ b/test/core/transport/transport_end2end_tests.c @@ -144,36 +144,36 @@ static gpr_slice alloc_recv_buffer(void *user_data, grpc_transport *transport, return gpr_slice_malloc(size_hint); } -static void pending_ops_cleanup() { +static void pending_ops_cleanup(void) { gpr_mu_destroy(&g_mu); gpr_cv_destroy(&g_cv); } -static void pending_ops_init() { +static void pending_ops_init(void) { gpr_mu_init(&g_mu); gpr_cv_init(&g_cv); atexit(pending_ops_cleanup); } -static void use_pending_ops() { +static void use_pending_ops(void) { gpr_once_init(&g_pending_ops_init, pending_ops_init); } -static void add_pending_op() { +static void add_pending_op(void) { use_pending_ops(); gpr_mu_lock(&g_mu); g_pending_ops++; gpr_mu_unlock(&g_mu); } -static void end_pending_op() { +static void end_pending_op(void) { gpr_mu_lock(&g_mu); g_pending_ops--; gpr_cv_broadcast(&g_cv); gpr_mu_unlock(&g_mu); } -static void wait_pending_ops() { +static void wait_pending_ops(void) { use_pending_ops(); gpr_mu_lock(&g_mu); while (g_pending_ops > 0) { diff --git a/test/core/util/grpc_profiler.c b/test/core/util/grpc_profiler.c index e135743d57..340b2d53b9 100644 --- a/test/core/util/grpc_profiler.c +++ b/test/core/util/grpc_profiler.c @@ -35,4 +35,4 @@ void grpc_profiler_start(const char *filename) {} -void grpc_profiler_stop() {} +void grpc_profiler_stop(void) {} diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c index 5f51478f8c..52008895dc 100644 --- a/test/core/util/port_posix.c +++ b/test/core/util/port_posix.c @@ -98,7 +98,7 @@ static int is_port_available(int *port, int is_tcp) { return 1; } -int grpc_pick_unused_port() { +int grpc_pick_unused_port(void) { /* We repeatedly pick a port and then see whether or not it is available for use both as a TCP socket and a UDP socket. First, we pick a random large port number. For subsequent @@ -141,7 +141,7 @@ int grpc_pick_unused_port() { return 0; } -int grpc_pick_unused_port_or_die() { +int grpc_pick_unused_port_or_die(void) { int port = grpc_pick_unused_port(); GPR_ASSERT(port > 0); return port; diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 44ab35fc5e..6df86b593f 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -39,7 +39,7 @@ #if GPR_GETPID_IN_UNISTD_H #include <unistd.h> -static int seed() { return getpid(); } +static int seed(void) { return getpid(); } #endif #if GPR_GETPID_IN_PROCESS_H |