From be98d248419fbb22db47e8d66b884676fdaf9238 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 10 Nov 2017 15:26:57 -0800 Subject: clang-format after nullptr changes --- test/core/bad_client/bad_client.cc | 12 ++-- test/core/bad_client/tests/connection_prefix.cc | 3 +- test/core/bad_client/tests/headers.cc | 3 +- .../bad_client/tests/initial_settings_frame.cc | 3 +- test/core/bad_ssl/server_common.cc | 8 +-- test/core/bad_ssl/servers/alpn.cc | 4 +- test/core/bad_ssl/servers/cert.cc | 4 +- test/core/channel/minimal_stack_is_minimal_test.cc | 13 +++-- test/core/client_channel/lb_policies_test.cc | 40 ++++++------- test/core/client_channel/parse_address_test.cc | 4 +- .../resolvers/dns_resolver_connectivity_test.cc | 3 +- test/core/end2end/bad_server_response_test.cc | 4 +- test/core/end2end/connection_refused_test.cc | 18 +++--- test/core/end2end/cq_verifier.cc | 3 +- test/core/end2end/dualstack_socket_test.cc | 3 +- test/core/end2end/fixtures/h2_census.cc | 3 +- test/core/end2end/fixtures/h2_compress.cc | 4 +- test/core/end2end/fixtures/h2_fakesec.cc | 3 +- test/core/end2end/fixtures/h2_full+pipe.cc | 3 +- test/core/end2end/fixtures/h2_full+trace.cc | 3 +- test/core/end2end/fixtures/h2_full+workarounds.cc | 3 +- test/core/end2end/fixtures/h2_full.cc | 3 +- test/core/end2end/fixtures/h2_http_proxy.cc | 3 +- test/core/end2end/fixtures/h2_load_reporting.cc | 3 +- test/core/end2end/fixtures/h2_oauth2.cc | 7 ++- test/core/end2end/fixtures/h2_ssl.cc | 7 ++- test/core/end2end/fixtures/h2_ssl_proxy.cc | 11 ++-- test/core/end2end/fixtures/h2_uds.cc | 3 +- test/core/end2end/fixtures/http_proxy_fixture.cc | 4 +- test/core/end2end/fixtures/proxy.cc | 19 ++++--- test/core/end2end/fuzzers/api_fuzzer.cc | 31 ++++++---- test/core/end2end/fuzzers/client_fuzzer.cc | 9 ++- test/core/end2end/fuzzers/server_fuzzer.cc | 9 ++- test/core/end2end/goaway_server_test.cc | 3 +- test/core/end2end/invalid_call_argument_test.cc | 66 ++++++++++++++-------- test/core/end2end/no_server_test.cc | 11 ++-- test/core/end2end/tests/binary_metadata.cc | 5 +- test/core/end2end/tests/call_creds.cc | 4 +- .../core/end2end/tests/cancel_after_client_done.cc | 5 +- test/core/end2end/tests/cancel_after_round_trip.cc | 5 +- test/core/end2end/tests/cancel_with_status.cc | 3 +- test/core/end2end/tests/compressed_payload.cc | 28 +++++---- test/core/end2end/tests/filter_latency.cc | 4 +- .../core/end2end/tests/graceful_server_shutdown.cc | 5 +- test/core/end2end/tests/max_message_length.cc | 12 ++-- test/core/end2end/tests/ping_pong_streaming.cc | 6 +- test/core/end2end/tests/shutdown_finishes_calls.cc | 5 +- .../core/end2end/tests/simple_cacheable_request.cc | 4 +- test/core/end2end/tests/simple_metadata.cc | 5 +- .../tests/stream_compression_compressed_payload.cc | 13 +++-- .../stream_compression_ping_pong_streaming.cc | 6 +- .../core/end2end/tests/streaming_error_response.cc | 5 +- test/core/end2end/tests/trailing_metadata.cc | 5 +- .../end2end/tests/workaround_cronet_compression.cc | 6 +- test/core/fling/server.cc | 8 +-- test/core/http/httpcli_test.cc | 3 +- test/core/http/httpscli_test.cc | 3 +- test/core/iomgr/endpoint_tests.cc | 4 +- test/core/iomgr/fd_posix_test.cc | 31 +++++----- test/core/iomgr/resource_quota_test.cc | 17 +++--- test/core/iomgr/tcp_client_posix_test.cc | 12 ++-- test/core/iomgr/tcp_posix_test.cc | 12 ++-- test/core/iomgr/tcp_server_posix_test.cc | 4 +- test/core/iomgr/udp_server_test.cc | 8 +-- test/core/json/json_stream_error_test.cc | 2 +- test/core/memory_usage/client.cc | 10 ++-- test/core/memory_usage/server.cc | 14 +++-- test/core/security/credentials_test.cc | 58 ++++++++++--------- test/core/security/fetch_oauth2.cc | 3 +- test/core/security/json_token_test.cc | 6 +- test/core/security/secure_endpoint_test.cc | 10 ++-- test/core/support/alloc_test.cc | 3 +- test/core/surface/alarm_test.cc | 12 ++-- test/core/surface/completion_queue_test.cc | 31 +++++----- .../surface/completion_queue_threading_test.cc | 8 +-- test/core/surface/concurrent_connectivity_test.cc | 12 ++-- test/core/surface/lame_client_test.cc | 7 ++- .../num_external_connectivity_watchers_test.cc | 20 +++---- test/core/surface/secure_channel_create_test.cc | 6 +- test/core/surface/sequential_connectivity_test.cc | 10 ++-- test/core/surface/server_test.cc | 12 ++-- test/core/tsi/ssl_transport_security_test.cc | 13 +++-- test/core/tsi/transport_security_test.cc | 39 +++++++------ test/core/tsi/transport_security_test_lib.cc | 9 ++- test/core/util/test_config.cc | 2 +- test/core/util/trickle_endpoint.cc | 5 +- test/cpp/end2end/client_lb_end2end_test.cc | 3 +- test/cpp/grpclb/grpclb_test.cc | 24 ++++---- test/cpp/microbenchmarks/bm_call_create.cc | 19 ++++--- test/cpp/microbenchmarks/bm_closure.cc | 18 ++++-- test/cpp/microbenchmarks/bm_cq.cc | 3 +- test/cpp/microbenchmarks/bm_error.cc | 4 +- test/cpp/microbenchmarks/bm_pollset.cc | 7 ++- test/cpp/microbenchmarks/fullstack_fixtures.h | 6 +- test/cpp/naming/resolver_component_test.cc | 3 +- test/cpp/util/grpc_tool_test.cc | 16 +++--- 96 files changed, 554 insertions(+), 402 deletions(-) (limited to 'test') diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index c8bd005d5c..c19b7bdf40 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -175,9 +175,10 @@ void grpc_run_bad_client_test( grpc_exec_ctx_finish(&exec_ctx); do { GPR_ASSERT(gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0); - GPR_ASSERT(grpc_completion_queue_next( - a.cq, grpc_timeout_milliseconds_to_deadline(100), nullptr) - .type == GRPC_QUEUE_TIMEOUT); + GPR_ASSERT( + grpc_completion_queue_next( + a.cq, grpc_timeout_milliseconds_to_deadline(100), nullptr) + .type == GRPC_QUEUE_TIMEOUT); } while (!gpr_event_get(&read_done_event)); if (client_validator(&incoming)) break; gpr_log(GPR_INFO, @@ -198,8 +199,9 @@ void grpc_run_bad_client_test( gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(1))); shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_server_shutdown_and_notify(a.server, shutdown_cq, nullptr); - GPR_ASSERT(grpc_completion_queue_pluck( - shutdown_cq, nullptr, grpc_timeout_seconds_to_deadline(1), nullptr) + GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, nullptr, + grpc_timeout_seconds_to_deadline(1), + nullptr) .type == GRPC_OP_COMPLETE); grpc_completion_queue_destroy(shutdown_cq); grpc_server_destroy(a.server); diff --git a/test/core/bad_client/tests/connection_prefix.cc b/test/core/bad_client/tests/connection_prefix.cc index 8ffc5a5be8..47252f9f10 100644 --- a/test/core/bad_client/tests/connection_prefix.cc +++ b/test/core/bad_client/tests/connection_prefix.cc @@ -53,7 +53,8 @@ int main(int argc, char** argv) { GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSX", 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSMX", 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSM\rX", 0); - GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSM\r\nX", 0); + GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSM\r\nX", + 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, "PRI * HTTP/2.0\r\n\r\nSM\r\n\rX", 0); return 0; diff --git a/test/core/bad_client/tests/headers.cc b/test/core/bad_client/tests/headers.cc index e0b77e043a..50bb72c493 100644 --- a/test/core/bad_client/tests/headers.cc +++ b/test/core/bad_client/tests/headers.cc @@ -50,7 +50,8 @@ int main(int argc, char** argv) { GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x05", GRPC_BAD_CLIENT_DISCONNECT); - GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x04\x00", + GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, + PFX_STR "\x00\x00\x00\x01\x04\x00", GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x04\x00\x00", diff --git a/test/core/bad_client/tests/initial_settings_frame.cc b/test/core/bad_client/tests/initial_settings_frame.cc index 4a01c9ee3e..edc52f503e 100644 --- a/test/core/bad_client/tests/initial_settings_frame.cc +++ b/test/core/bad_client/tests/initial_settings_frame.cc @@ -55,7 +55,8 @@ int main(int argc, char** argv) { GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\xff", GRPC_BAD_CLIENT_DISCONNECT); - GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x00", + GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, + PFX_STR "\x00\x00\x00\x04\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x00\x00", diff --git a/test/core/bad_ssl/server_common.cc b/test/core/bad_ssl/server_common.cc index 068d707306..08842b8350 100644 --- a/test/core/bad_ssl/server_common.cc +++ b/test/core/bad_ssl/server_common.cc @@ -71,10 +71,10 @@ void bad_ssl_run(grpc_server* server) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_server_shutdown_and_notify(server, shutdown_cq, nullptr); - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, nullptr, - grpc_timeout_seconds_to_deadline(5), nullptr) - .type == GRPC_OP_COMPLETE); + GPR_ASSERT(grpc_completion_queue_pluck( + shutdown_cq, nullptr, grpc_timeout_seconds_to_deadline(5), + nullptr) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); shutdown_started = 1; diff --git a/test/core/bad_ssl/servers/alpn.cc b/test/core/bad_ssl/servers/alpn.cc index 591f0f2eef..23954d82fd 100644 --- a/test/core/bad_ssl/servers/alpn.cc +++ b/test/core/bad_ssl/servers/alpn.cc @@ -58,8 +58,8 @@ int main(int argc, char** argv) { grpc_server* server; grpc_init(); - ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_key_cert_pair, 1, 0, nullptr); + ssl_creds = grpc_ssl_server_credentials_create(nullptr, &pem_key_cert_pair, 1, + 0, nullptr); server = grpc_server_create(nullptr, nullptr); GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds)); grpc_server_credentials_release(ssl_creds); diff --git a/test/core/bad_ssl/servers/cert.cc b/test/core/bad_ssl/servers/cert.cc index 49895d902d..a51dd34e4b 100644 --- a/test/core/bad_ssl/servers/cert.cc +++ b/test/core/bad_ssl/servers/cert.cc @@ -49,8 +49,8 @@ int main(int argc, char** argv) { pem_key_cert_pair.private_key = (const char*)GRPC_SLICE_START_PTR(key_slice); pem_key_cert_pair.cert_chain = (const char*)GRPC_SLICE_START_PTR(cert_slice); - ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_key_cert_pair, 1, 0, nullptr); + ssl_creds = grpc_ssl_server_credentials_create(nullptr, &pem_key_cert_pair, 1, + 0, nullptr); server = grpc_server_create(nullptr, nullptr); GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds)); grpc_server_credentials_release(ssl_creds); diff --git a/test/core/channel/minimal_stack_is_minimal_test.cc b/test/core/channel/minimal_stack_is_minimal_test.cc index f6d7339ea1..e0cffa39a8 100644 --- a/test/core/channel/minimal_stack_is_minimal_test.cc +++ b/test/core/channel/minimal_stack_is_minimal_test.cc @@ -85,20 +85,21 @@ int main(int argc, char** argv) { // tests with a default stack errors += CHECK_STACK("unknown", nullptr, GRPC_CLIENT_DIRECT_CHANNEL, "message_size", "deadline", "connected", NULL); - errors += CHECK_STACK("unknown", nullptr, GRPC_CLIENT_SUBCHANNEL, "message_size", - "connected", NULL); + errors += CHECK_STACK("unknown", nullptr, GRPC_CLIENT_SUBCHANNEL, + "message_size", "connected", NULL); errors += CHECK_STACK("unknown", nullptr, GRPC_SERVER_CHANNEL, "server", "message_size", "deadline", "connected", NULL); errors += CHECK_STACK("chttp2", nullptr, GRPC_CLIENT_DIRECT_CHANNEL, "message_size", "deadline", "http-client", "message_compress", "connected", NULL); - errors += CHECK_STACK("chttp2", nullptr, GRPC_CLIENT_SUBCHANNEL, "message_size", - "http-client", "message_compress", "connected", NULL); + errors += + CHECK_STACK("chttp2", nullptr, GRPC_CLIENT_SUBCHANNEL, "message_size", + "http-client", "message_compress", "connected", NULL); errors += CHECK_STACK("chttp2", nullptr, GRPC_SERVER_CHANNEL, "server", "message_size", "deadline", "http-server", "message_compress", "connected", NULL); - errors += - CHECK_STACK(nullptr, nullptr, GRPC_CLIENT_CHANNEL, "client-channel", NULL); + errors += CHECK_STACK(nullptr, nullptr, GRPC_CLIENT_CHANNEL, "client-channel", + NULL); GPR_ASSERT(errors == 0); grpc_shutdown(); diff --git a/test/core/client_channel/lb_policies_test.cc b/test/core/client_channel/lb_policies_test.cc index 486ad2c212..5f8d3b84cc 100644 --- a/test/core/client_channel/lb_policies_test.cc +++ b/test/core/client_channel/lb_policies_test.cc @@ -286,9 +286,10 @@ static request_sequences perform_request(servers_fixture* f, memset(s_valid, 0, f->num_servers * sizeof(int)); grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr"); - c = grpc_channel_create_call(client, nullptr, GRPC_PROPAGATE_DEFAULTS, f->cq, - grpc_slice_from_static_string("/foo"), &host, - gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + c = grpc_channel_create_call(client, nullptr, GRPC_PROPAGATE_DEFAULTS, + f->cq, grpc_slice_from_static_string("/foo"), + &host, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(c); completed_client = 0; @@ -317,14 +318,14 @@ static request_sequences perform_request(servers_fixture* f, op->flags = 0; op->reserved = nullptr; op++; - GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), nullptr)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, (size_t)(op - ops), + tag(1), nullptr)); s_idx = -1; - while ( - (ev = grpc_completion_queue_next( - f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), nullptr)) - .type != GRPC_QUEUE_TIMEOUT) { + while ((ev = grpc_completion_queue_next( + f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), + nullptr)) + .type != GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(intptr_t)ev.tag); const grpc_connectivity_state conn_state = @@ -401,10 +402,10 @@ static request_sequences perform_request(servers_fixture* f, } } - GPR_ASSERT( - grpc_completion_queue_next( - f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), nullptr) - .type == GRPC_QUEUE_TIMEOUT); + GPR_ASSERT(grpc_completion_queue_next( + f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), + nullptr) + .type == GRPC_QUEUE_TIMEOUT); grpc_metadata_array_destroy(&rdata->initial_metadata_recv); grpc_metadata_array_destroy(&rdata->trailing_metadata_recv); @@ -451,10 +452,10 @@ static grpc_call** perform_multirequest(servers_fixture* f, grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr"); for (i = 0; i < concurrent_calls; i++) { - calls[i] = - grpc_channel_create_call(client, nullptr, GRPC_PROPAGATE_DEFAULTS, f->cq, - grpc_slice_from_static_string("/foo"), &host, - gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + calls[i] = grpc_channel_create_call( + client, nullptr, GRPC_PROPAGATE_DEFAULTS, f->cq, + grpc_slice_from_static_string("/foo"), &host, + gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(calls[i]); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[i], ops, (size_t)(op - ops), tag(1), @@ -602,9 +603,8 @@ static void test_pending_calls(size_t concurrent_calls) { client = create_client(f); calls = perform_multirequest(f, client, concurrent_calls); - grpc_call_cancel( - calls[0], - nullptr); /* exercise the cancel pick path whilst there are pending picks */ + grpc_call_cancel(calls[0], nullptr); /* exercise the cancel pick path whilst + there are pending picks */ gpr_free(rdata.call_details); diff --git a/test/core/client_channel/parse_address_test.cc b/test/core/client_channel/parse_address_test.cc index 938cef309e..94f76da920 100644 --- a/test/core/client_channel/parse_address_test.cc +++ b/test/core/client_channel/parse_address_test.cc @@ -63,7 +63,7 @@ static void test_grpc_parse_ipv4(const char* uri_text, const char* host, struct sockaddr_in* addr_in = (struct sockaddr_in*)addr.addr; GPR_ASSERT(AF_INET == addr_in->sin_family); GPR_ASSERT(nullptr != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf, - sizeof(ntop_buf))); + sizeof(ntop_buf))); GPR_ASSERT(0 == strcmp(ntop_buf, host)); GPR_ASSERT(ntohs(addr_in->sin_port) == port); @@ -82,7 +82,7 @@ static void test_grpc_parse_ipv6(const char* uri_text, const char* host, struct sockaddr_in6* addr_in6 = (struct sockaddr_in6*)addr.addr; GPR_ASSERT(AF_INET6 == addr_in6->sin6_family); GPR_ASSERT(nullptr != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf, - sizeof(ntop_buf))); + sizeof(ntop_buf))); GPR_ASSERT(0 == strcmp(ntop_buf, host)); GPR_ASSERT(ntohs(addr_in6->sin6_port) == port); GPR_ASSERT(addr_in6->sin6_scope_id == scope_id); diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc index f377abc269..dcf315eba5 100644 --- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc @@ -73,7 +73,8 @@ static grpc_ares_request* my_dns_lookup_ares( } else { gpr_mu_unlock(&g_mu); *lb_addrs = grpc_lb_addresses_create(1, nullptr); - grpc_lb_addresses_set_address(*lb_addrs, 0, nullptr, 0, false, nullptr, nullptr); + grpc_lb_addresses_set_address(*lb_addrs, 0, nullptr, 0, false, nullptr, + nullptr); } GRPC_CLOSURE_SCHED(exec_ctx, on_done, error); return nullptr; diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc index 04275e2c2a..b0c6ae926e 100644 --- a/test/core/end2end/bad_server_response_test.cc +++ b/test/core/end2end/bad_server_response_test.cc @@ -197,8 +197,8 @@ static void start_rpc(int target_port, grpc_status_code expected_status, op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(state.call, ops, (size_t)(op - ops), tag(1), nullptr); + error = grpc_call_start_batch(state.call, ops, (size_t)(op - ops), tag(1), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); diff --git a/test/core/end2end/connection_refused_test.cc b/test/core/end2end/connection_refused_test.cc index 7fc36706f8..f3f2dda91d 100644 --- a/test/core/end2end/connection_refused_test.cc +++ b/test/core/end2end/connection_refused_test.cc @@ -83,9 +83,10 @@ static void run_test(bool wait_for_ready, bool use_service_config) { chan = grpc_insecure_channel_create(addr, args, nullptr); grpc_slice host = grpc_slice_from_static_string("nonexistant"); gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2); - call = grpc_channel_create_call( - chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, - grpc_slice_from_static_string("/service/method"), &host, deadline, nullptr); + call = + grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, + grpc_slice_from_static_string("/service/method"), + &host, deadline, nullptr); gpr_free(addr); @@ -105,8 +106,9 @@ static void run_test(bool wait_for_ready, bool use_service_config) { op->flags = 0; op->reserved = nullptr; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch( - call, ops, (size_t)(op - ops), tag(1), nullptr)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, + (size_t)(op - ops), tag(1), + nullptr)); /* verify that all tags get completed */ CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); @@ -118,9 +120,9 @@ static void run_test(bool wait_for_ready, bool use_service_config) { } grpc_completion_queue_shutdown(cq); - while ( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type != GRPC_QUEUE_SHUTDOWN) + while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type != GRPC_QUEUE_SHUTDOWN) ; grpc_completion_queue_destroy(cq); grpc_call_unref(call); diff --git a/test/core/end2end/cq_verifier.cc b/test/core/end2end/cq_verifier.cc index d595124c00..8686f4e7b7 100644 --- a/test/core/end2end/cq_verifier.cc +++ b/test/core/end2end/cq_verifier.cc @@ -290,7 +290,8 @@ void cq_verify_empty_timeout(cq_verifier* v, int timeout_sec) { gpr_time_from_seconds(timeout_sec, GPR_TIMESPAN)); grpc_event ev; - GPR_ASSERT(v->first_expectation == nullptr && "expectation queue must be empty"); + GPR_ASSERT(v->first_expectation == nullptr && + "expectation queue must be empty"); ev = grpc_completion_queue_next(v->cq, deadline, nullptr); if (ev.type != GRPC_QUEUE_TIMEOUT) { diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc index 2c7a6cfbbc..ad2b24fdb0 100644 --- a/test/core/end2end/dualstack_socket_test.cc +++ b/test/core/end2end/dualstack_socket_test.cc @@ -211,7 +211,8 @@ void test_connect(const char* server_host, const char* client_host, int port, op->data.recv_close_on_server.cancelled = &was_cancelled; op->flags = 0; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc index 89d992cf52..fed8ead5c8 100644 --- a/test/core/end2end/fixtures/h2_census.cc +++ b/test/core/end2end/fixtures/h2_census.cc @@ -71,7 +71,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, static_cast(f->fixture_data); grpc_arg arg = make_census_enable_arg(); client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index fbf4d2061b..ea8990fd0a 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -72,8 +72,8 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f, } ffd->client_args_compression = grpc_channel_args_set_compression_algorithm( client_args, GRPC_COMPRESS_GZIP); - f->client = grpc_insecure_channel_create(ffd->localaddr, - ffd->client_args_compression, nullptr); + f->client = grpc_insecure_channel_create( + ffd->localaddr, ffd->client_args_compression, nullptr); } void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f, diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc index 570d040976..87d4668d50 100644 --- a/test/core/end2end/fixtures/h2_fakesec.cc +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -118,7 +118,8 @@ static void chttp2_init_server_fake_secure_fullstack( grpc_server_credentials* fake_ts_creds = grpc_fake_transport_security_server_credentials_create(); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, nullptr}; + grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, + nullptr}; grpc_server_credentials_set_auth_metadata_processor(fake_ts_creds, processor); } diff --git a/test/core/end2end/fixtures/h2_full+pipe.cc b/test/core/end2end/fixtures/h2_full+pipe.cc index 306c85871b..b080591e85 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.cc +++ b/test/core/end2end/fixtures/h2_full+pipe.cc @@ -66,7 +66,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_full+trace.cc b/test/core/end2end/fixtures/h2_full+trace.cc index 589bf1d7e4..a49de96009 100644 --- a/test/core/end2end/fixtures/h2_full+trace.cc +++ b/test/core/end2end/fixtures/h2_full+trace.cc @@ -66,7 +66,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_full+workarounds.cc b/test/core/end2end/fixtures/h2_full+workarounds.cc index ffe2623c44..71a497d796 100644 --- a/test/core/end2end/fixtures/h2_full+workarounds.cc +++ b/test/core/end2end/fixtures/h2_full+workarounds.cc @@ -64,7 +64,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_full.cc b/test/core/end2end/fixtures/h2_full.cc index c0a9524cc6..6d15c28662 100644 --- a/test/core/end2end/fixtures/h2_full.cc +++ b/test/core/end2end/fixtures/h2_full.cc @@ -60,7 +60,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_http_proxy.cc b/test/core/end2end/fixtures/h2_http_proxy.cc index 45f6cb56ac..099367d91b 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.cc +++ b/test/core/end2end/fixtures/h2_http_proxy.cc @@ -81,7 +81,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, } gpr_setenv("http_proxy", proxy_uri); gpr_free(proxy_uri); - f->client = grpc_insecure_channel_create(ffd->server_addr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->server_addr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_load_reporting.cc b/test/core/end2end/fixtures/h2_load_reporting.cc index c0aa8ebdce..7486b6af78 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.cc +++ b/test/core/end2end/fixtures/h2_load_reporting.cc @@ -62,7 +62,8 @@ void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { load_reporting_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); GPR_ASSERT(f->client); } diff --git a/test/core/end2end/fixtures/h2_oauth2.cc b/test/core/end2end/fixtures/h2_oauth2.cc index 474a1b4b9e..1642cb0db9 100644 --- a/test/core/end2end/fixtures/h2_oauth2.cc +++ b/test/core/end2end/fixtures/h2_oauth2.cc @@ -149,7 +149,8 @@ static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack( grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create( &exec_ctx, "authorization", oauth2_md, true /* is_async */); grpc_channel_credentials* ssl_oauth2_creds = - grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, nullptr); + grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, + nullptr); grpc_arg ssl_name_override = { GRPC_ARG_STRING, const_cast(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), @@ -200,8 +201,8 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_key_cert_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_key_cert_pair, 1, 0, nullptr); grpc_server_credentials_set_auth_metadata_processor( ssl_creds, test_processor_create(fail_server_auth_check(server_args))); chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/h2_ssl.cc b/test/core/end2end/fixtures/h2_ssl.cc index 047b5d7510..3d7e2e327e 100644 --- a/test/core/end2end/fixtures/h2_ssl.cc +++ b/test/core/end2end/fixtures/h2_ssl.cc @@ -132,10 +132,11 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_cert_key_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_cert_key_pair, 1, 0, nullptr); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, nullptr}; + grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, + nullptr}; grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); } chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.cc b/test/core/end2end/fixtures/h2_ssl_proxy.cc index 7191210261..f8d5a699e4 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.cc +++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc @@ -44,8 +44,8 @@ static grpc_server* create_proxy_server(const char* port, grpc_server* s = grpc_server_create(server_args, nullptr); grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_cert_key_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_cert_key_pair, 1, 0, nullptr); GPR_ASSERT(grpc_server_add_secure_http2_port(s, port, ssl_creds)); grpc_server_credentials_release(ssl_creds); return s; @@ -170,10 +170,11 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_cert_key_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_cert_key_pair, 1, 0, nullptr); if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, nullptr}; + grpc_auth_metadata_processor processor = {process_auth_failure, nullptr, + nullptr}; grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); } chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); diff --git a/test/core/end2end/fixtures/h2_uds.cc b/test/core/end2end/fixtures/h2_uds.cc index 553244f800..28f0a50e15 100644 --- a/test/core/end2end/fixtures/h2_uds.cc +++ b/test/core/end2end/fixtures/h2_uds.cc @@ -66,7 +66,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); + f->client = + grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc index ab4197e95c..0bdd15c57d 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -348,8 +348,8 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg, // Read request and feed it to the parser. for (size_t i = 0; i < conn->client_read_buffer.count; ++i) { if (GRPC_SLICE_LENGTH(conn->client_read_buffer.slices[i]) > 0) { - error = grpc_http_parser_parse(&conn->http_parser, - conn->client_read_buffer.slices[i], nullptr); + error = grpc_http_parser_parse( + &conn->http_parser, conn->client_read_buffer.slices[i], nullptr); if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, true /* is_client */, "HTTP proxy request parse", error); diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc index 3d3eed495c..2fab62b721 100644 --- a/test/core/end2end/fixtures/proxy.cc +++ b/test/core/end2end/fixtures/proxy.cc @@ -163,8 +163,9 @@ static void on_p2s_recv_initial_metadata(void* arg, int success) { op.data.send_initial_metadata.count = pc->p2s_initial_metadata.count; op.data.send_initial_metadata.metadata = pc->p2s_initial_metadata.metadata; refpc(pc, "on_c2p_sent_initial_metadata"); - err = grpc_call_start_batch( - pc->c2p, &op, 1, new_closure(on_c2p_sent_initial_metadata, pc), nullptr); + err = grpc_call_start_batch(pc->c2p, &op, 1, + new_closure(on_c2p_sent_initial_metadata, pc), + nullptr); GPR_ASSERT(err == GRPC_CALL_OK); } @@ -215,8 +216,8 @@ static void on_c2p_recv_msg(void* arg, int success) { op.reserved = nullptr; op.data.send_message.send_message = pc->c2p_msg; refpc(pc, "on_p2s_sent_message"); - err = grpc_call_start_batch(pc->p2s, &op, 1, - new_closure(on_p2s_sent_message, pc), nullptr); + err = grpc_call_start_batch( + pc->p2s, &op, 1, new_closure(on_p2s_sent_message, pc), nullptr); GPR_ASSERT(err == GRPC_CALL_OK); } else { op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; @@ -339,8 +340,9 @@ static void on_new_call(void* arg, int success) { op.data.recv_initial_metadata.recv_initial_metadata = &pc->p2s_initial_metadata; refpc(pc, "on_p2s_recv_initial_metadata"); - err = grpc_call_start_batch( - pc->p2s, &op, 1, new_closure(on_p2s_recv_initial_metadata, pc), nullptr); + err = grpc_call_start_batch(pc->p2s, &op, 1, + new_closure(on_p2s_recv_initial_metadata, pc), + nullptr); GPR_ASSERT(err == GRPC_CALL_OK); op.op = GRPC_OP_SEND_INITIAL_METADATA; @@ -348,8 +350,9 @@ static void on_new_call(void* arg, int success) { op.data.send_initial_metadata.count = pc->c2p_initial_metadata.count; op.data.send_initial_metadata.metadata = pc->c2p_initial_metadata.metadata; refpc(pc, "on_p2s_sent_initial_metadata"); - err = grpc_call_start_batch( - pc->p2s, &op, 1, new_closure(on_p2s_sent_initial_metadata, pc), nullptr); + err = grpc_call_start_batch(pc->p2s, &op, 1, + new_closure(on_p2s_sent_initial_metadata, pc), + nullptr); GPR_ASSERT(err == GRPC_CALL_OK); op.op = GRPC_OP_RECV_MESSAGE; diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc index 4ee063fc84..b8ec12586e 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.cc +++ b/test/core/end2end/fuzzers/api_fuzzer.cc @@ -249,7 +249,8 @@ static const char* read_cred_artifact(cred_artifact_ctx* ctx, input_stream* inp, size_t num_builtins) { uint8_t b = next_byte(inp); if (b == 0) return nullptr; - if (b == 1) return ctx->release[ctx->num_release++] = read_string(inp, nullptr); + if (b == 1) + return ctx->release[ctx->num_release++] = read_string(inp, nullptr); if (b >= num_builtins + 1) { end(inp); return nullptr; @@ -272,7 +273,8 @@ static grpc_channel_credentials* read_ssl_channel_creds(input_stream* inp) { GPR_ARRAY_SIZE(builtin_cert_chains)); grpc_ssl_pem_key_cert_pair key_cert_pair = {private_key, certs}; grpc_channel_credentials* creds = grpc_ssl_credentials_create( - root_certs, private_key != nullptr && certs != nullptr ? &key_cert_pair : nullptr, + root_certs, + private_key != nullptr && certs != nullptr ? &key_cert_pair : nullptr, nullptr); cred_artifact_ctx_finish(&ctx); return creds; @@ -317,10 +319,11 @@ static grpc_call_credentials* read_call_creds(input_stream* inp) { cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT; const char* auth_token = read_cred_artifact(&ctx, inp, nullptr, 0); const char* auth_selector = read_cred_artifact(&ctx, inp, nullptr, 0); - grpc_call_credentials* out = auth_token == nullptr || auth_selector == nullptr - ? nullptr - : grpc_google_iam_credentials_create( - auth_token, auth_selector, nullptr); + grpc_call_credentials* out = + auth_token == nullptr || auth_selector == nullptr + ? nullptr + : grpc_google_iam_credentials_create(auth_token, auth_selector, + nullptr); cred_artifact_ctx_finish(&ctx); return out; } @@ -388,7 +391,8 @@ static void finish_resolve(grpc_exec_ctx* exec_ctx, void* arg, *r->addrs = addrs; } else if (r->lb_addrs != nullptr) { grpc_lb_addresses* lb_addrs = grpc_lb_addresses_create(1, nullptr); - grpc_lb_addresses_set_address(lb_addrs, 0, nullptr, 0, false, nullptr, nullptr); + grpc_lb_addresses_set_address(lb_addrs, 0, nullptr, 0, false, nullptr, + nullptr); *r->lb_addrs = lb_addrs; } GRPC_CLOSURE_SCHED(exec_ctx, r->on_done, GRPC_ERROR_NONE); @@ -465,7 +469,8 @@ static void do_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { grpc_transport* transport = grpc_create_chttp2_transport(exec_ctx, nullptr, server, 0); - grpc_server_setup_transport(exec_ctx, g_server, transport, nullptr, nullptr); + grpc_server_setup_transport(exec_ctx, g_server, transport, nullptr, + nullptr); grpc_chttp2_transport_start_reading(exec_ctx, transport, nullptr); GRPC_CLOSURE_SCHED(exec_ctx, fc->closure, GRPC_ERROR_NONE); @@ -1084,8 +1089,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (ok) { validator* v = make_finished_batch_validator(g_active_call, has_ops); g_active_call->pending_ops++; - grpc_call_error error = - grpc_call_start_batch(g_active_call->call, ops, num_ops, v, nullptr); + grpc_call_error error = grpc_call_start_batch( + g_active_call->call, ops, num_ops, v, nullptr); if (error != GRPC_CALL_OK) { v->validate(v->arg, false); gpr_free(v); @@ -1133,7 +1138,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (g_channel != nullptr) { pending_pings++; grpc_channel_ping(g_channel, cq, - create_validator(decrement, &pending_pings), nullptr); + create_validator(decrement, &pending_pings), + nullptr); } else { end(&inp); } @@ -1195,7 +1201,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { gpr_asprintf(&target_uri, "dns:%s", target); grpc_channel_args* args = read_args(&inp); grpc_channel_credentials* creds = read_channel_creds(&inp); - g_channel = grpc_secure_channel_create(creds, target_uri, args, nullptr); + g_channel = + grpc_secure_channel_create(creds, target_uri, args, nullptr); GPR_ASSERT(g_channel != nullptr); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc index e4255a7a0a..ebc8c2780d 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.cc +++ b/test/core/end2end/fuzzers/client_fuzzer.cc @@ -113,7 +113,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { grpc_event ev; while (1) { grpc_exec_ctx_flush(&exec_ctx); - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); switch (ev.type) { case GRPC_QUEUE_TIMEOUT: goto done; @@ -130,12 +131,14 @@ done: grpc_call_cancel(call, nullptr); } for (int i = 0; i < requested_calls; i++) { - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); } grpc_completion_queue_shutdown(cq); for (int i = 0; i < requested_calls; i++) { - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); } grpc_call_unref(call); diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc index 177f6b47c4..fb6477b579 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.cc +++ b/test/core/end2end/fuzzers/server_fuzzer.cc @@ -80,7 +80,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { grpc_event ev; while (1) { grpc_exec_ctx_flush(&exec_ctx); - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); switch (ev.type) { case GRPC_QUEUE_TIMEOUT: goto done; @@ -103,12 +104,14 @@ done: grpc_server_shutdown_and_notify(server, cq, tag(0xdead)); grpc_server_cancel_all_calls(server); for (int i = 0; i <= requested_calls; i++) { - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); } grpc_completion_queue_shutdown(cq); for (int i = 0; i <= requested_calls; i++) { - ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); } grpc_server_destroy(server); diff --git a/test/core/end2end/goaway_server_test.cc b/test/core/end2end/goaway_server_test.cc index 1d37848b3f..2d0db967c3 100644 --- a/test/core/end2end/goaway_server_test.cc +++ b/test/core/end2end/goaway_server_test.cc @@ -176,7 +176,8 @@ int main(int argc, char** argv) { client_args.num_args = 1; /* create a channel that picks first amongst the servers */ - grpc_channel* chan = grpc_insecure_channel_create("test", &client_args, nullptr); + grpc_channel* chan = + grpc_insecure_channel_create("test", &client_args, nullptr); /* and an initial call to them */ grpc_slice host = grpc_slice_from_static_string("127.0.0.1"); grpc_call* call1 = diff --git a/test/core/end2end/invalid_call_argument_test.cc b/test/core/end2end/invalid_call_argument_test.cc index ff7f710095..cb6b4c08ef 100644 --- a/test/core/end2end/invalid_call_argument_test.cc +++ b/test/core/end2end/invalid_call_argument_test.cc @@ -72,7 +72,8 @@ static void prepare_test(int is_client) { grpc_slice host = grpc_slice_from_static_string("nonexistant"); g_state.call = grpc_channel_create_call( g_state.chan, nullptr, GRPC_PROPAGATE_DEFAULTS, g_state.cq, - grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, nullptr); + grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, + nullptr); } else { g_state.server = grpc_server_create(nullptr, nullptr); grpc_server_register_completion_queue(g_state.server, g_state.cq, nullptr); @@ -81,12 +82,14 @@ static void prepare_test(int is_client) { grpc_server_start(g_state.server); gpr_free(server_hostport); gpr_join_host_port(&server_hostport, "localhost", port); - g_state.chan = grpc_insecure_channel_create(server_hostport, nullptr, nullptr); + g_state.chan = + grpc_insecure_channel_create(server_hostport, nullptr, nullptr); gpr_free(server_hostport); grpc_slice host = grpc_slice_from_static_string("bar"); g_state.call = grpc_channel_create_call( g_state.chan, nullptr, GRPC_PROPAGATE_DEFAULTS, g_state.cq, - grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, nullptr); + grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, + nullptr); grpc_metadata_array_init(&g_state.server_initial_metadata_recv); grpc_call_details_init(&g_state.call_details); op = g_state.ops; @@ -162,7 +165,8 @@ static void test_non_null_reserved_on_op() { op++; GPR_ASSERT(GRPC_CALL_ERROR == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -192,7 +196,8 @@ static void test_send_initial_metadata_more_than_once() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -210,7 +215,8 @@ static void test_too_many_metadata() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -233,7 +239,8 @@ static void test_send_null_message() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_MESSAGE == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -264,7 +271,8 @@ static void test_send_messages_at_the_same_time() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); grpc_byte_buffer_destroy(request_payload); cleanup_test(); } @@ -286,7 +294,8 @@ static void test_send_server_status_from_client() { op++; GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -316,7 +325,8 @@ static void test_receive_initial_metadata_twice_at_client() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -334,7 +344,8 @@ static void test_receive_message_with_invalid_flags() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -357,7 +368,8 @@ static void test_receive_two_messages_at_the_same_time() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -375,7 +387,8 @@ static void test_recv_close_on_server_from_client() { op++; GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -410,7 +423,8 @@ static void test_recv_status_on_client_twice() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } @@ -427,7 +441,8 @@ static void test_send_close_from_client_on_server() { op++; GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -448,7 +463,8 @@ static void test_recv_status_on_client_from_server() { op++; GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -469,7 +485,8 @@ static void test_send_status_from_server_with_invalid_flags() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -491,7 +508,8 @@ static void test_too_many_trailing_metadata() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -519,7 +537,8 @@ static void test_send_server_status_twice() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -537,7 +556,8 @@ static void test_recv_close_on_server_with_invalid_flags() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -560,7 +580,8 @@ static void test_recv_close_on_server_twice() { op++; GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS == grpc_call_start_batch(g_state.server_call, g_state.ops, - (size_t)(op - g_state.ops), tag(2), nullptr)); + (size_t)(op - g_state.ops), tag(2), + nullptr)); cleanup_test(); } @@ -582,7 +603,8 @@ static void test_invalid_initial_metadata_reserved_key() { op++; GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA == grpc_call_start_batch(g_state.call, g_state.ops, - (size_t)(op - g_state.ops), tag(1), nullptr)); + (size_t)(op - g_state.ops), tag(1), + nullptr)); cleanup_test(); } diff --git a/test/core/end2end/no_server_test.cc b/test/core/end2end/no_server_test.cc index a35ec575fd..6113885171 100644 --- a/test/core/end2end/no_server_test.cc +++ b/test/core/end2end/no_server_test.cc @@ -68,8 +68,9 @@ int main(int argc, char** argv) { op->flags = 0; op->reserved = nullptr; op++; - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch( - call, ops, (size_t)(op - ops), tag(1), nullptr)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, + (size_t)(op - ops), tag(1), + nullptr)); /* verify that all tags get completed */ CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); @@ -77,9 +78,9 @@ int main(int argc, char** argv) { GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED); grpc_completion_queue_shutdown(cq); - while ( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type != GRPC_QUEUE_SHUTDOWN) + while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type != GRPC_QUEUE_SHUTDOWN) ; grpc_completion_queue_destroy(cq); grpc_call_unref(call); diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index b22bd35711..381671e331 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -119,8 +119,9 @@ static void test_request_response_with_metadata_and_payload( "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"), 0, {{nullptr, nullptr, nullptr, nullptr}}}}; - grpc_end2end_test_fixture f = begin_test( - config, "test_request_response_with_metadata_and_payload", nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_request_response_with_metadata_and_payload", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index fb9d8554ce..e1c868232c 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -170,8 +170,8 @@ static void request_response_with_payload_and_call_creds( break; case OVERRIDE: grpc_call_credentials_release(creds); - creds = grpc_google_iam_credentials_create(overridden_iam_token, - overridden_iam_selector, nullptr); + creds = grpc_google_iam_credentials_create( + overridden_iam_token, overridden_iam_selector, nullptr); GPR_ASSERT(creds != nullptr); GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK); break; diff --git a/test/core/end2end/tests/cancel_after_client_done.cc b/test/core/end2end/tests/cancel_after_client_done.cc index 28379a2f6e..9b832d435d 100644 --- a/test/core/end2end/tests/cancel_after_client_done.cc +++ b/test/core/end2end/tests/cancel_after_client_done.cc @@ -94,8 +94,9 @@ static void test_cancel_after_accept_and_writes_closed( grpc_op* op; grpc_call* c; grpc_call* s; - grpc_end2end_test_fixture f = begin_test( - config, "test_cancel_after_accept_and_writes_closed", mode, nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_cancel_after_accept_and_writes_closed", mode, + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index 6d547662dd..ddcec67de5 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -140,8 +140,9 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, args = grpc_channel_args_copy_and_add(args, &arg, 1); } - grpc_end2end_test_fixture f = begin_test( - config, "cancel_after_round_trip", mode, use_service_config, args, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "cancel_after_round_trip", mode, use_service_config, + args, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); gpr_timespec deadline = use_service_config diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index cc5498d6b3..c867751d53 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -167,7 +167,8 @@ static void test_invoke_simple_request(grpc_end2end_test_config config, size_t num_ops) { grpc_end2end_test_fixture f; - f = begin_test(config, "test_invoke_simple_request", num_ops, nullptr, nullptr); + f = begin_test(config, "test_invoke_simple_request", num_ops, nullptr, + nullptr); simple_request_body(config, f, num_ops); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index 8ffcbe89cb..a8ea0ff2e0 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -421,7 +421,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = + grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); } @@ -433,7 +434,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -451,7 +453,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -560,8 +563,8 @@ static void test_invoke_request_with_uncompressed_payload( request_with_payload_template( config, "test_invoke_request_with_uncompressed_payload", 0, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, - GRPC_COMPRESS_NONE, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, - false); + GRPC_COMPRESS_NONE, nullptr, false, + /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false); } static void test_invoke_request_with_compressed_payload( @@ -569,8 +572,8 @@ static void test_invoke_request_with_compressed_payload( request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, - GRPC_COMPRESS_GZIP, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, - false); + GRPC_COMPRESS_GZIP, nullptr, false, + /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false); } static void test_invoke_request_with_send_message_before_initial_metadata( @@ -578,8 +581,8 @@ static void test_invoke_request_with_send_message_before_initial_metadata( request_with_payload_template( config, "test_invoke_request_with_compressed_payload", 0, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, - GRPC_COMPRESS_GZIP, nullptr, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE, - true); + GRPC_COMPRESS_GZIP, nullptr, false, + /* ignored */ GRPC_COMPRESS_LEVEL_NONE, true); } static void test_invoke_request_with_server_level( @@ -630,9 +633,10 @@ static void test_invoke_request_with_compressed_payload_md_override( static void test_invoke_request_with_disabled_algorithm( grpc_end2end_test_config config) { - request_for_disabled_algorithm( - config, "test_invoke_request_with_disabled_algorithm", 0, - GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_STATUS_UNIMPLEMENTED, nullptr); + request_for_disabled_algorithm(config, + "test_invoke_request_with_disabled_algorithm", + 0, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, + GRPC_STATUS_UNIMPLEMENTED, nullptr); } void compressed_payload(grpc_end2end_test_config config) { diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc index 07fee4c451..c4d96ebfe2 100644 --- a/test/core/end2end/tests/filter_latency.cc +++ b/test/core/end2end/tests/filter_latency.cc @@ -321,8 +321,8 @@ static bool maybe_add_filter(grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder_iterator* it = grpc_channel_stack_builder_create_iterator_at_last(builder); GPR_ASSERT(grpc_channel_stack_builder_move_prev(it)); - const bool retval = - grpc_channel_stack_builder_add_filter_before(it, filter, nullptr, nullptr); + const bool retval = grpc_channel_stack_builder_add_filter_before( + it, filter, nullptr, nullptr); grpc_channel_stack_builder_iterator_destroy(it); return retval; } else { diff --git a/test/core/end2end/tests/graceful_server_shutdown.cc b/test/core/end2end/tests/graceful_server_shutdown.cc index 1c8acf37a4..bf11b49fa4 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.cc +++ b/test/core/end2end/tests/graceful_server_shutdown.cc @@ -84,8 +84,9 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; - grpc_end2end_test_fixture f = begin_test( - config, "test_early_server_shutdown_finishes_inflight_calls", nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index e9c3785057..f1ac27fa7c 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -174,8 +174,10 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, server_args); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - if (client_args != nullptr) grpc_channel_args_destroy(&exec_ctx, client_args); - if (server_args != nullptr) grpc_channel_args_destroy(&exec_ctx, server_args); + if (client_args != nullptr) + grpc_channel_args_destroy(&exec_ctx, client_args); + if (server_args != nullptr) + grpc_channel_args_destroy(&exec_ctx, server_args); grpc_exec_ctx_finish(&exec_ctx); } @@ -365,8 +367,10 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, server_args); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - if (client_args != nullptr) grpc_channel_args_destroy(&exec_ctx, client_args); - if (server_args != nullptr) grpc_channel_args_destroy(&exec_ctx, server_args); + if (client_args != nullptr) + grpc_channel_args_destroy(&exec_ctx, client_args); + if (server_args != nullptr) + grpc_channel_args_destroy(&exec_ctx, server_args); grpc_exec_ctx_finish(&exec_ctx); } cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/ping_pong_streaming.cc b/test/core/end2end/tests/ping_pong_streaming.cc index 47aebe52a1..ec7981fdcb 100644 --- a/test/core/end2end/tests/ping_pong_streaming.cc +++ b/test/core/end2end/tests/ping_pong_streaming.cc @@ -195,7 +195,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -207,7 +208,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); diff --git a/test/core/end2end/tests/shutdown_finishes_calls.cc b/test/core/end2end/tests/shutdown_finishes_calls.cc index b939877cf0..fce23f3b6a 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.cc +++ b/test/core/end2end/tests/shutdown_finishes_calls.cc @@ -77,8 +77,9 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; - grpc_end2end_test_fixture f = begin_test( - config, "test_early_server_shutdown_finishes_inflight_calls", nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/simple_cacheable_request.cc b/test/core/end2end/tests/simple_cacheable_request.cc index 02c9f49d52..d8034dcf6d 100644 --- a/test/core/end2end/tests/simple_cacheable_request.cc +++ b/test/core/end2end/tests/simple_cacheable_request.cc @@ -116,8 +116,8 @@ static void test_cacheable_request_response_with_metadata_and_payload( 0, {{nullptr, nullptr, nullptr, nullptr}}}}; grpc_end2end_test_fixture f = begin_test( - config, "test_cacheable_request_response_with_metadata_and_payload", nullptr, - nullptr); + config, "test_cacheable_request_response_with_metadata_and_payload", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc index 38adcbae28..1a741169d4 100644 --- a/test/core/end2end/tests/simple_metadata.cc +++ b/test/core/end2end/tests/simple_metadata.cc @@ -113,8 +113,9 @@ static void test_request_response_with_metadata_and_payload( grpc_slice_from_static_string("val4"), 0, {{nullptr, nullptr, nullptr, nullptr}}}}; - grpc_end2end_test_fixture f = begin_test( - config, "test_request_response_with_metadata_and_payload", nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_request_response_with_metadata_and_payload", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.cc b/test/core/end2end/tests/stream_compression_compressed_payload.cc index e662a38a30..d73346468a 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.cc +++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc @@ -440,7 +440,8 @@ static void request_with_payload_template( op->flags = client_send_flags_bitmask; op->reserved = nullptr; op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); + error = + grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); } @@ -452,7 +453,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); @@ -468,7 +470,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); memset(ops, 0, sizeof(ops)); @@ -580,8 +583,8 @@ static void test_invoke_request_with_server_level( config, "test_invoke_request_with_server_level", 0, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_GZIP, - /* ignored */ nullptr, true, GRPC_STREAM_COMPRESS_LEVEL_HIGH, false, false, - GRPC_COMPRESS_NONE); + /* ignored */ nullptr, true, GRPC_STREAM_COMPRESS_LEVEL_HIGH, false, + false, GRPC_COMPRESS_NONE); } static void test_invoke_request_with_compressed_payload_md_override( diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc index 1cd87c9d9c..d3b526f04e 100644 --- a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc +++ b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc @@ -204,7 +204,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -216,7 +217,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); diff --git a/test/core/end2end/tests/streaming_error_response.cc b/test/core/end2end/tests/streaming_error_response.cc index d011b6aa36..fe53fda9ef 100644 --- a/test/core/end2end/tests/streaming_error_response.cc +++ b/test/core/end2end/tests/streaming_error_response.cc @@ -99,8 +99,9 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { grpc_slice response_payload2_slice = grpc_slice_from_copied_string("world"); grpc_byte_buffer* response_payload2 = grpc_raw_byte_buffer_create(&response_payload2_slice, 1); - grpc_end2end_test_fixture f = begin_test(config, "streaming_error_response", - nullptr, nullptr, request_status_early); + grpc_end2end_test_fixture f = + begin_test(config, "streaming_error_response", nullptr, nullptr, + request_status_early); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc index 8a6be7a892..afc56c8dfa 100644 --- a/test/core/end2end/tests/trailing_metadata.cc +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -121,8 +121,9 @@ static void test_request_response_with_metadata_and_payload( grpc_slice_from_static_string("val6"), 0, {{nullptr, nullptr, nullptr, nullptr}}}}; - grpc_end2end_test_fixture f = begin_test( - config, "test_request_response_with_metadata_and_payload", nullptr, nullptr); + grpc_end2end_test_fixture f = + begin_test(config, "test_request_response_with_metadata_and_payload", + nullptr, nullptr); cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op* op; diff --git a/test/core/end2end/tests/workaround_cronet_compression.cc b/test/core/end2end/tests/workaround_cronet_compression.cc index 71d461f469..bc4d5079d8 100644 --- a/test/core/end2end/tests/workaround_cronet_compression.cc +++ b/test/core/end2end/tests/workaround_cronet_compression.cc @@ -258,7 +258,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(102), 1); cq_verify(cqv); @@ -275,7 +276,8 @@ static void request_with_payload_template( op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(103), 1); CQ_EXPECT_COMPLETION(cqv, tag(2), 1); diff --git a/test/core/fling/server.cc b/test/core/fling/server.cc index dfe96136fb..f3a8a1ccf8 100644 --- a/test/core/fling/server.cc +++ b/test/core/fling/server.cc @@ -234,10 +234,10 @@ int main(int argc, char** argv) { shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), nullptr) - .type == GRPC_OP_COMPLETE); + GPR_ASSERT(grpc_completion_queue_pluck( + shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), nullptr) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index b9e3051dcd..81e9374819 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -53,7 +53,8 @@ static void on_finish(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { g_done = 1; GPR_ASSERT(GRPC_LOG_IF_ERROR( "pollset_kick", - grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), nullptr))); + grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), + nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index cac0ed5ce7..da8405c049 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -53,7 +53,8 @@ static void on_finish(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { g_done = 1; GPR_ASSERT(GRPC_LOG_IF_ERROR( "pollset_kick", - grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), nullptr))); + grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), + nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc index 83aa23a60f..026e34105d 100644 --- a/test/core/iomgr/endpoint_tests.cc +++ b/test/core/iomgr/endpoint_tests.cc @@ -258,8 +258,8 @@ static void inc_on_failure(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { gpr_mu_lock(g_mu); *(int*)arg += (error != GRPC_ERROR_NONE); - GPR_ASSERT( - GRPC_LOG_IF_ERROR("kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc index 240588bf52..a03d841ecd 100644 --- a/test/core/iomgr/fd_posix_test.cc +++ b/test/core/iomgr/fd_posix_test.cc @@ -115,8 +115,8 @@ static void session_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg, /*session */ bool success) { session* se = static_cast(arg); server* sv = se->sv; - grpc_fd_orphan(exec_ctx, se->em_fd, nullptr, nullptr, false /* already_closed */, - "a"); + grpc_fd_orphan(exec_ctx, se->em_fd, nullptr, nullptr, + false /* already_closed */, "a"); gpr_free(se); /* Start to shutdown listen fd. */ grpc_fd_shutdown(exec_ctx, sv->em_fd, @@ -173,13 +173,13 @@ static void listen_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg /*server */, int success) { server* sv = static_cast(arg); - grpc_fd_orphan(exec_ctx, sv->em_fd, nullptr, nullptr, false /* already_closed */, - "b"); + grpc_fd_orphan(exec_ctx, sv->em_fd, nullptr, nullptr, + false /* already_closed */, "b"); gpr_mu_lock(g_mu); sv->done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -292,11 +292,11 @@ static void client_init(client* cl) { static void client_session_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg /*client */, int success) { client* cl = static_cast(arg); - grpc_fd_orphan(exec_ctx, cl->em_fd, nullptr, nullptr, false /* already_closed */, - "c"); + grpc_fd_orphan(exec_ctx, cl->em_fd, nullptr, nullptr, + false /* already_closed */, "c"); cl->done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); } /* Write as much as possible, then register notify_on_write. */ @@ -413,8 +413,8 @@ static void first_read_callback(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); fdc->cb_that_ran = first_read_callback; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -425,8 +425,8 @@ static void second_read_callback(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); fdc->cb_that_ran = second_read_callback; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -507,7 +507,8 @@ static void test_grpc_fd_change(void) { GPR_ASSERT(b.cb_that_ran == second_read_callback); gpr_mu_unlock(g_mu); - grpc_fd_orphan(&exec_ctx, em_fd, nullptr, nullptr, false /* already_closed */, "d"); + grpc_fd_orphan(&exec_ctx, em_fd, nullptr, nullptr, false /* already_closed */, + "d"); grpc_exec_ctx_finish(&exec_ctx); destroy_change_data(&a); destroy_change_data(&b); diff --git a/test/core/iomgr/resource_quota_test.cc b/test/core/iomgr/resource_quota_test.cc index a0ce4018dc..6851702e67 100644 --- a/test/core/iomgr/resource_quota_test.cc +++ b/test/core/iomgr/resource_quota_test.cc @@ -189,7 +189,8 @@ static void test_async_alloc_blocked_by_size(void) { &ev, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); } grpc_resource_quota_resize(q, 1024); - GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != + nullptr); ; { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -638,8 +639,8 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated)); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&allocated, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline( + 5)) != nullptr); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -657,7 +658,8 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( grpc_resource_user_free(&exec_ctx, usr, 1024); grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + grpc_timeout_seconds_to_deadline(5)) != + nullptr); } } grpc_resource_quota_unref(q); @@ -697,10 +699,11 @@ static void test_reclaimers_can_be_posted_repeatedly(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated)); grpc_exec_ctx_finish(&exec_ctx); - GPR_ASSERT(gpr_event_wait(&allocated, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline( + 5)) != nullptr); GPR_ASSERT(gpr_event_wait(&reclaimer_done, - grpc_timeout_seconds_to_deadline(5)) != nullptr); + grpc_timeout_seconds_to_deadline(5)) != + nullptr); } } { diff --git a/test/core/iomgr/tcp_client_posix_test.cc b/test/core/iomgr/tcp_client_posix_test.cc index c87c146c34..9fb1a2d770 100644 --- a/test/core/iomgr/tcp_client_posix_test.cc +++ b/test/core/iomgr/tcp_client_posix_test.cc @@ -54,8 +54,8 @@ static void finish_connection() { gpr_mu_lock(g_mu); g_connections_complete++; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(&exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(&exec_ctx, g_pollset, nullptr))); grpc_exec_ctx_finish(&exec_ctx); gpr_mu_unlock(g_mu); } @@ -108,8 +108,8 @@ void test_succeeds(void) { GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len) == 0); GRPC_CLOSURE_INIT(&done, must_succeed, nullptr, grpc_schedule_on_exec_ctx); - grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, nullptr, - &resolved_addr, GRPC_MILLIS_INF_FUTURE); + grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, + nullptr, &resolved_addr, GRPC_MILLIS_INF_FUTURE); /* await the connection */ do { @@ -157,8 +157,8 @@ void test_fails(void) { /* connect to a broken address */ GRPC_CLOSURE_INIT(&done, must_fail, nullptr, grpc_schedule_on_exec_ctx); - grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, nullptr, - &resolved_addr, GRPC_MILLIS_INF_FUTURE); + grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, + nullptr, &resolved_addr, GRPC_MILLIS_INF_FUTURE); gpr_mu_lock(g_mu); diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc index 98b3d1594d..7986dc2b19 100644 --- a/test/core/iomgr/tcp_posix_test.cc +++ b/test/core/iomgr/tcp_posix_test.cc @@ -147,8 +147,8 @@ static void read_cb(grpc_exec_ctx* exec_ctx, void* user_data, gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes, state->target_read_bytes); if (state->read_bytes >= state->target_read_bytes) { - GPR_ASSERT(GRPC_LOG_IF_ERROR("kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } else { grpc_endpoint_read(exec_ctx, state->ep, &state->incoming, &state->read_cb); @@ -297,8 +297,8 @@ static void write_done(grpc_exec_ctx* exec_ctx, gpr_mu_lock(g_mu); gpr_log(GPR_INFO, "Signalling write done"); state->write_done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -408,8 +408,8 @@ static void write_test(size_t num_bytes, size_t slice_size) { void on_fd_released(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* errors) { int* done = (int*)arg; *done = 1; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); } /* Do a read_test, then release fd and try to read/write again. Verify that diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc index 2651d29f99..48d8d425a5 100644 --- a/test/core/iomgr/tcp_server_posix_test.cc +++ b/test/core/iomgr/tcp_server_posix_test.cc @@ -159,8 +159,8 @@ static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp, gpr_mu_lock(g_mu); g_result = temp_result; g_nconnects++; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/iomgr/udp_server_test.cc b/test/core/iomgr/udp_server_test.cc index 08871695a7..803f017106 100644 --- a/test/core/iomgr/udp_server_test.cc +++ b/test/core/iomgr/udp_server_test.cc @@ -61,8 +61,8 @@ static void on_read(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) { g_number_of_reads++; g_number_of_bytes_read += (int)byte_count; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } @@ -70,8 +70,8 @@ static void on_write(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) { gpr_mu_lock(g_mu); g_number_of_writes++; - GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick", - grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); + GPR_ASSERT(GRPC_LOG_IF_ERROR( + "pollset_kick", grpc_pollset_kick(exec_ctx, g_pollset, nullptr))); gpr_mu_unlock(g_mu); } diff --git a/test/core/json/json_stream_error_test.cc b/test/core/json/json_stream_error_test.cc index 70b00c77f9..b367d3fbf7 100644 --- a/test/core/json/json_stream_error_test.cc +++ b/test/core/json/json_stream_error_test.cc @@ -38,7 +38,7 @@ static uint32_t read_char(void* userdata) { return GRPC_JSON_READ_CHAR_ERROR; } static grpc_json_reader_vtable reader_vtable = { string_clear, nullptr, nullptr, read_char, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; static void read_error() { grpc_json_reader reader; diff --git a/test/core/memory_usage/client.cc b/test/core/memory_usage/client.cc index 3741c7f7ad..eb90067970 100644 --- a/test/core/memory_usage/client.cc +++ b/test/core/memory_usage/client.cc @@ -142,9 +142,10 @@ static struct grpc_memory_counters send_snapshot_request(int call_idx, calls[call_idx].call = grpc_channel_create_call( channel, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, call_type, &hostname, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); - GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch( - calls[call_idx].call, snapshot_ops, - (size_t)(op - snapshot_ops), (void*)nullptr, nullptr)); + GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[call_idx].call, + snapshot_ops, + (size_t)(op - snapshot_ops), + (void*)nullptr, nullptr)); grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); grpc_byte_buffer_reader reader; @@ -320,7 +321,8 @@ int main(int argc, char** argv) { benchmark_iterations, server_calls_end.total_size_relative - after_server_create.total_size_relative, - env_build == nullptr ? "" : env_build, env_job == nullptr ? "" : env_job); + env_build == nullptr ? "" : env_build, + env_job == nullptr ? "" : env_job); fclose(csv); gpr_log(GPR_INFO, "Summary written to %s", csv_file); } diff --git a/test/core/memory_usage/server.cc b/test/core/memory_usage/server.cc index 0d796439ce..60ebcece3e 100644 --- a/test/core/memory_usage/server.cc +++ b/test/core/memory_usage/server.cc @@ -88,7 +88,8 @@ static void send_initial_metadata_unary(void* tag) { metadata_ops[0].data.send_initial_metadata.count = 0; GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call*)tag).call, - metadata_ops, 1, tag, nullptr)); + metadata_ops, 1, tag, + nullptr)); } static void send_status(void* tag) { @@ -99,7 +100,8 @@ static void send_status(void* tag) { status_op.data.send_status_from_server.status_details = &details; GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call*)tag).call, - &status_op, 1, tag, nullptr)); + &status_op, 1, tag, + nullptr)); } static void send_snapshot(void* tag, struct grpc_memory_counters* snapshot) { @@ -219,10 +221,10 @@ int main(int argc, char** argv) { shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); - GPR_ASSERT( - grpc_completion_queue_pluck(shutdown_cq, tag(1000), - grpc_timeout_seconds_to_deadline(5), nullptr) - .type == GRPC_OP_COMPLETE); + GPR_ASSERT(grpc_completion_queue_pluck( + shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), nullptr) + .type == GRPC_OP_COMPLETE); grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_shutdown(cq); shutdown_started = 1; diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index f9d6e444f3..64d383ad0a 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -404,8 +404,8 @@ static void test_google_iam_creds(void) { grpc_call_credentials* creds = grpc_google_iam_credentials_create( test_google_iam_authorization_token, test_google_iam_authority_selector, nullptr); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state); grpc_call_credentials_unref(&exec_ctx, creds); grpc_exec_ctx_finish(&exec_ctx); @@ -418,8 +418,8 @@ static void test_access_token_creds(void) { make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd)); grpc_call_credentials* creds = grpc_access_token_credentials_create("blah", nullptr); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0); run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state); grpc_call_credentials_unref(&exec_ctx, creds); @@ -468,8 +468,8 @@ static void test_oauth2_google_iam_composite_creds(void) { test_google_iam_authority_selector}}; request_metadata_state* state = make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd)); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create( &exec_ctx, "authorization", test_oauth2_bearer_token, 0); grpc_call_credentials* google_iam_creds = grpc_google_iam_credentials_create( @@ -517,7 +517,8 @@ static void test_channel_oauth2_google_iam_composite_creds(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_channel_args* new_args; grpc_channel_credentials_vtable vtable = { - nullptr, check_channel_oauth2_google_iam_create_security_connector, nullptr}; + nullptr, check_channel_oauth2_google_iam_create_security_connector, + nullptr}; grpc_channel_credentials* channel_creds = grpc_mock_channel_credentials_create(&vtable); grpc_call_credentials* oauth2_creds = @@ -600,8 +601,8 @@ static void test_compute_engine_creds_success(void) { {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; grpc_call_credentials* creds = grpc_google_compute_engine_credentials_create(nullptr); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; /* First request: http get should be called. */ request_metadata_state* state = @@ -630,8 +631,8 @@ static void test_compute_engine_creds_failure(void) { GRPC_ERROR_CREATE_FROM_STATIC_STRING( "Error occured when fetching oauth2 token."), nullptr, 0); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; grpc_call_credentials* creds = grpc_google_compute_engine_credentials_create(nullptr); grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override, @@ -689,8 +690,8 @@ static void test_refresh_token_creds_success(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; expected_md emd[] = { {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create( test_refresh_token_str, nullptr); @@ -721,8 +722,8 @@ static void test_refresh_token_creds_failure(void) { GRPC_ERROR_CREATE_FROM_STATIC_STRING( "Error occured when fetching oauth2 token."), nullptr, 0); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create( test_refresh_token_str, nullptr); grpc_httpcli_set_override(httpcli_get_should_not_be_called, @@ -821,8 +822,8 @@ static void test_jwt_creds_lifetime(void) { static void test_jwt_creds_success(void) { char* json_key_string = test_json_key_str(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; char* expected_md_value; gpr_asprintf(&expected_md_value, "Bearer %s", test_signed_jwt); expected_md emd[] = {{"authorization", expected_md_value}}; @@ -864,10 +865,11 @@ static void test_jwt_creds_success(void) { static void test_jwt_creds_signing_failure(void) { char* json_key_string = test_json_key_str(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; request_metadata_state* state = make_request_metadata_state( - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), nullptr, 0); + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), nullptr, + 0); grpc_call_credentials* creds = grpc_service_account_jwt_access_credentials_create( json_key_string, grpc_max_auth_token_lifetime(), nullptr); @@ -959,8 +961,8 @@ static void test_google_default_creds_gce(void) { {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; request_metadata_state* state = make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd)); - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; grpc_flush_cached_google_default_credentials(); gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ grpc_override_well_known_credentials_path_getter( @@ -1092,8 +1094,8 @@ static void test_metadata_plugin_success(void) { plugin_state state = PLUGIN_INITIAL_STATE; grpc_metadata_credentials_plugin plugin; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; request_metadata_state* md_state = make_request_metadata_state( GRPC_ERROR_NONE, plugin_md, GPR_ARRAY_SIZE(plugin_md)); @@ -1115,8 +1117,8 @@ static void test_metadata_plugin_failure(void) { plugin_state state = PLUGIN_INITIAL_STATE; grpc_metadata_credentials_plugin plugin; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, nullptr, - nullptr}; + grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, + nullptr, nullptr}; char* expected_error; gpr_asprintf(&expected_error, "Getting metadata from plugin failed with error: %s", @@ -1234,8 +1236,8 @@ static void test_auth_metadata_context(void) { grpc_slice_from_copied_string(test_cases[i].call_method); grpc_auth_metadata_context auth_md_context; memset(&auth_md_context, 0, sizeof(auth_md_context)); - grpc_auth_metadata_context_build(url_scheme, call_host, call_method, nullptr, - &auth_md_context); + grpc_auth_metadata_context_build(url_scheme, call_host, call_method, + nullptr, &auth_md_context); if (strcmp(auth_md_context.service_url, test_cases[i].desired_service_url) != 0) { gpr_log(GPR_ERROR, "Invalid service url, want: %s, got %s.", diff --git a/test/core/security/fetch_oauth2.cc b/test/core/security/fetch_oauth2.cc index 69c470641a..cb28a0487c 100644 --- a/test/core/security/fetch_oauth2.cc +++ b/test/core/security/fetch_oauth2.cc @@ -60,7 +60,8 @@ int main(int argc, char** argv) { grpc_init(); - if (json_key_file_path != nullptr && json_refresh_token_file_path != nullptr) { + if (json_key_file_path != nullptr && + json_refresh_token_file_path != nullptr) { gpr_log(GPR_ERROR, "--json_key and --json_refresh_token are mutually exclusive."); exit(1); diff --git a/test/core/security/json_token_test.cc b/test/core/security/json_token_test.cc index 0dee341169..0b6ccd5e37 100644 --- a/test/core/security/json_token_test.cc +++ b/test/core/security/json_token_test.cc @@ -78,7 +78,8 @@ static const char test_scope[] = "myperm1 myperm2"; static const char test_service_url[] = "https://foo.com/foo.v1"; static char* test_json_key_str(const char* bad_part3) { - const char* part3 = bad_part3 != nullptr ? bad_part3 : test_json_key_str_part3; + const char* part3 = + bad_part3 != nullptr ? bad_part3 : test_json_key_str_part3; size_t result_len = strlen(test_json_key_str_part1) + strlen(test_json_key_str_part2) + strlen(part3); char* result = static_cast(gpr_malloc(result_len + 1)); @@ -339,7 +340,8 @@ static void check_jwt_signature(const char* b64_signature, RSA* rsa_key, GPR_ASSERT(key != nullptr); EVP_PKEY_set1_RSA(key, rsa_key); - GPR_ASSERT(EVP_DigestVerifyInit(md_ctx, nullptr, EVP_sha256(), nullptr, key) == 1); + GPR_ASSERT( + EVP_DigestVerifyInit(md_ctx, nullptr, EVP_sha256(), nullptr, key) == 1); GPR_ASSERT(EVP_DigestVerifyUpdate(md_ctx, signed_data, signed_data_size) == 1); GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GRPC_SLICE_START_PTR(sig), diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc index 2d4c6b1b88..a12af02479 100644 --- a/test/core/security/secure_endpoint_test.cc +++ b/test/core/security/secure_endpoint_test.cc @@ -44,11 +44,13 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair( tsi_frame_protector* fake_write_protector = tsi_create_fake_frame_protector(nullptr); tsi_zero_copy_grpc_protector* fake_read_zero_copy_protector = - use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(nullptr) - : nullptr; + use_zero_copy_protector + ? tsi_create_fake_zero_copy_grpc_protector(nullptr) + : nullptr; tsi_zero_copy_grpc_protector* fake_write_zero_copy_protector = - use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(nullptr) - : nullptr; + use_zero_copy_protector + ? tsi_create_fake_zero_copy_grpc_protector(nullptr) + : nullptr; grpc_endpoint_test_fixture f; grpc_endpoint_pair tcp; diff --git a/test/core/support/alloc_test.cc b/test/core/support/alloc_test.cc index c9e88400ef..6074c6e6e7 100644 --- a/test/core/support/alloc_test.cc +++ b/test/core/support/alloc_test.cc @@ -30,7 +30,8 @@ static void test_custom_allocs() { const gpr_allocation_functions default_fns = gpr_get_allocation_functions(); intptr_t addr_to_free = 0; char* i; - gpr_allocation_functions fns = {fake_malloc, nullptr, fake_realloc, fake_free}; + gpr_allocation_functions fns = {fake_malloc, nullptr, fake_realloc, + fake_free}; gpr_set_allocation_functions(fns); GPR_ASSERT((void*)(size_t)0xdeadbeef == gpr_malloc(0xdeadbeef)); diff --git a/test/core/surface/alarm_test.cc b/test/core/surface/alarm_test.cc index 6865d2add9..8950603b41 100644 --- a/test/core/surface/alarm_test.cc +++ b/test/core/surface/alarm_test.cc @@ -34,7 +34,8 @@ static void* create_test_tag(void) { static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = + grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -49,7 +50,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, + nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2), nullptr); @@ -63,7 +65,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, + nullptr); grpc_alarm_cancel(alarm, nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), @@ -78,7 +81,8 @@ static void test_alarm(void) { grpc_event ev; void* tag = create_test_tag(); grpc_alarm* alarm = grpc_alarm_create(nullptr); - grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, nullptr); + grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, + nullptr); grpc_alarm_destroy(alarm, nullptr); ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc index e70fe5fec1..c6e13d2386 100644 --- a/test/core/surface/completion_queue_test.cc +++ b/test/core/surface/completion_queue_test.cc @@ -44,8 +44,8 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { break; } case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, create_test_tag(), gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); break; } default: { @@ -114,7 +114,8 @@ static void test_wait_empty(void) { attr.cq_polling_type = polling_types[i]; cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); - event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), nullptr); + event = + grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); } @@ -148,7 +149,8 @@ static void test_cq_end_op(void) { grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, &completion); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); GPR_ASSERT(ev.success); @@ -186,7 +188,8 @@ static void test_cq_tls_cache_full(void) { grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, do_nothing_end_completion, nullptr, &completion); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); GPR_ASSERT( @@ -194,7 +197,8 @@ static void test_cq_tls_cache_full(void) { GPR_ASSERT(res_tag == tag); GPR_ASSERT(ok); - ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); @@ -247,8 +251,8 @@ static void test_shutdown_then_next_polling(void) { cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); grpc_completion_queue_shutdown(cc); - event = - grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + event = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } @@ -313,8 +317,8 @@ static void test_pluck(void) { } for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { - ev = grpc_completion_queue_pluck(cc, tags[i], - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, tags[i], gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.tag == tags[i]); } @@ -326,7 +330,8 @@ static void test_pluck(void) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1], - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + gpr_inf_past(GPR_CLOCK_REALTIME), + nullptr); GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]); } @@ -351,8 +356,8 @@ static void test_pluck_after_shutdown(void) { cc = grpc_completion_queue_create( grpc_completion_queue_factory_lookup(&attr), &attr, nullptr); grpc_completion_queue_shutdown(cc); - ev = grpc_completion_queue_pluck(cc, nullptr, - gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, nullptr, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cc); } diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc index 457f96e95c..af54e00c4a 100644 --- a/test/core/surface/completion_queue_threading_test.cc +++ b/test/core/surface/completion_queue_threading_test.cc @@ -45,8 +45,8 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { break; } case GRPC_CQ_PLUCK: { - ev = grpc_completion_queue_pluck(cc, create_test_tag(), - gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); + ev = grpc_completion_queue_pluck( + cc, create_test_tag(), gpr_inf_past(GPR_CLOCK_REALTIME), nullptr); break; } default: { @@ -191,8 +191,8 @@ static void consumer_thread(void* arg) { gpr_log(GPR_INFO, "consumer %d phase 2", opt->id); for (;;) { - ev = grpc_completion_queue_next(opt->cc, - gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr); + ev = grpc_completion_queue_next( + opt->cc, gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr); switch (ev.type) { case GRPC_OP_COMPLETE: GPR_ASSERT(ev.success); diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc index d1f5bf1072..8fa15ab331 100644 --- a/test/core/surface/concurrent_connectivity_test.cc +++ b/test/core/surface/concurrent_connectivity_test.cc @@ -60,14 +60,16 @@ static int detag(void* p) { return (int)(uintptr_t)p; } void create_loop_destroy(void* addr) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - grpc_channel* chan = grpc_insecure_channel_create((char*)addr, nullptr, nullptr); + grpc_channel* chan = + grpc_insecure_channel_create((char*)addr, nullptr, nullptr); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { gpr_timespec later_time = grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS); grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 1); - grpc_channel_watch_connectivity_state(chan, state, later_time, cq, nullptr); + grpc_channel_watch_connectivity_state(chan, state, later_time, cq, + nullptr); gpr_timespec poll_time = grpc_timeout_milliseconds_to_deadline(POLL_MILLIS); GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, nullptr).type == @@ -239,7 +241,8 @@ int run_concurrent_connectivity_test() { void watches_with_short_timeouts(void* addr) { for (int i = 0; i < NUM_OUTER_LOOPS_SHORT_TIMEOUTS; ++i) { grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - grpc_channel* chan = grpc_insecure_channel_create((char*)addr, nullptr, nullptr); + grpc_channel* chan = + grpc_insecure_channel_create((char*)addr, nullptr, nullptr); for (int j = 0; j < NUM_INNER_LOOPS_SHORT_TIMEOUTS; ++j) { gpr_timespec later_time = @@ -247,7 +250,8 @@ void watches_with_short_timeouts(void* addr) { grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 0); GPR_ASSERT(state == GRPC_CHANNEL_IDLE); - grpc_channel_watch_connectivity_state(chan, state, later_time, cq, nullptr); + grpc_channel_watch_connectivity_state(chan, state, later_time, cq, + nullptr); gpr_timespec poll_time = grpc_timeout_milliseconds_to_deadline(POLL_MILLIS_SHORT_TIMEOUTS); grpc_event ev = grpc_completion_queue_next(cq, poll_time, nullptr); diff --git a/test/core/surface/lame_client_test.cc b/test/core/surface/lame_client_test.cc index 71ec0cb6d6..f3df7f35a7 100644 --- a/test/core/surface/lame_client_test.cc +++ b/test/core/surface/lame_client_test.cc @@ -96,9 +96,10 @@ int main(int argc, char** argv) { cq = grpc_completion_queue_create_for_next(nullptr); grpc_slice host = grpc_slice_from_static_string("anywhere"); - call = grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, - grpc_slice_from_static_string("/Foo"), &host, - grpc_timeout_seconds_to_deadline(100), nullptr); + call = + grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, + grpc_slice_from_static_string("/Foo"), &host, + grpc_timeout_seconds_to_deadline(100), nullptr); GPR_ASSERT(call); cqv = cq_verifier_create(cq); diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc index b08e28c0fc..f78d333673 100644 --- a/test/core/surface/num_external_connectivity_watchers_test.cc +++ b/test/core/surface/num_external_connectivity_watchers_test.cc @@ -50,8 +50,8 @@ static void channel_idle_start_watch(grpc_channel* channel, static void channel_idle_poll_for_timeout(grpc_channel* channel, grpc_completion_queue* cq) { - grpc_event ev = - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + grpc_event ev = grpc_completion_queue_next( + cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); /* expect watch_connectivity_state to end with a timeout */ GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); @@ -105,9 +105,9 @@ static void run_timeouts_test(const test_fixture* fixture) { grpc_channel_destroy(channel); grpc_completion_queue_shutdown(cq); - GPR_ASSERT( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type == GRPC_QUEUE_SHUTDOWN); + GPR_ASSERT(grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cq); grpc_shutdown(); @@ -141,16 +141,16 @@ static void run_channel_shutdown_before_timeout_test( connect_deadline, cq, (void*)1); grpc_channel_destroy(channel); - grpc_event ev = - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); + grpc_event ev = grpc_completion_queue_next( + cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); /* expect success with a state transition to CHANNEL_SHUTDOWN */ GPR_ASSERT(ev.success == true); grpc_completion_queue_shutdown(cq); - GPR_ASSERT( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type == GRPC_QUEUE_SHUTDOWN); + GPR_ASSERT(grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type == GRPC_QUEUE_SHUTDOWN); grpc_completion_queue_destroy(cq); grpc_shutdown(); diff --git a/test/core/surface/secure_channel_create_test.cc b/test/core/surface/secure_channel_create_test.cc index dcd1f2ef10..c31c61430c 100644 --- a/test/core/surface/secure_channel_create_test.cc +++ b/test/core/surface/secure_channel_create_test.cc @@ -51,7 +51,8 @@ void test_security_connector_already_in_arg(void) { grpc_channel_args args; args.num_args = 1; args.args = &arg; - grpc_channel* chan = grpc_secure_channel_create(nullptr, nullptr, &args, nullptr); + grpc_channel* chan = + grpc_secure_channel_create(nullptr, nullptr, &args, nullptr); grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); @@ -61,7 +62,8 @@ void test_security_connector_already_in_arg(void) { } void test_null_creds(void) { - grpc_channel* chan = grpc_secure_channel_create(nullptr, nullptr, nullptr, nullptr); + grpc_channel* chan = + grpc_secure_channel_create(nullptr, nullptr, nullptr, nullptr); grpc_channel_element* elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0); GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client")); diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc index 5bf3b12c73..015db92cb0 100644 --- a/test/core/surface/sequential_connectivity_test.cc +++ b/test/core/surface/sequential_connectivity_test.cc @@ -104,9 +104,9 @@ static void run_test(const test_fixture* fixture) { gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) .type != GRPC_QUEUE_SHUTDOWN) ; - while ( - grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr) - .type != GRPC_QUEUE_SHUTDOWN) + while (grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), + nullptr) + .type != GRPC_QUEUE_SHUTDOWN) ; for (size_t i = 0; i < NUM_CONNECTIONS; i++) { @@ -138,8 +138,8 @@ static const test_fixture insecure_test = { static void secure_test_add_port(grpc_server* server, const char* addr) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials* ssl_creds = - grpc_ssl_server_credentials_create(nullptr, &pem_cert_key_pair, 1, 0, nullptr); + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create( + nullptr, &pem_cert_key_pair, 1, 0, nullptr); grpc_server_add_secure_http2_port(server, addr, ssl_creds); grpc_server_credentials_release(ssl_creds); } diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc index 1998cab3e3..969b8cb11b 100644 --- a/test/core/surface/server_test.cc +++ b/test/core/surface/server_test.cc @@ -31,8 +31,8 @@ void test_register_method_fail(void) { grpc_server* server = grpc_server_create(nullptr, nullptr); void* method; void* method_old; - method = - grpc_server_register_method(server, nullptr, nullptr, GRPC_SRM_PAYLOAD_NONE, 0); + method = grpc_server_register_method(server, nullptr, nullptr, + GRPC_SRM_PAYLOAD_NONE, 0); GPR_ASSERT(method == nullptr); method_old = grpc_server_register_method(server, "m", "h", GRPC_SRM_PAYLOAD_NONE, 0); @@ -58,10 +58,12 @@ void test_request_call_on_no_server_cq(void) { grpc_completion_queue* cc = grpc_completion_queue_create_for_next(nullptr); grpc_server* server = grpc_server_create(nullptr, nullptr); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_call(server, nullptr, nullptr, nullptr, cc, cc, nullptr)); + grpc_server_request_call(server, nullptr, nullptr, nullptr, cc, cc, + nullptr)); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_registered_call(server, nullptr, nullptr, nullptr, nullptr, - nullptr, cc, cc, nullptr)); + grpc_server_request_registered_call(server, nullptr, nullptr, + nullptr, nullptr, nullptr, cc, + cc, nullptr)); grpc_completion_queue_destroy(cc); grpc_server_destroy(server); } diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 03367d85e5..8939c0434b 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -125,8 +125,9 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { key_cert_lib->use_bad_server_cert ? key_cert_lib->bad_server_num_key_cert_pairs : key_cert_lib->server_num_key_cert_pairs, - key_cert_lib->root_cert, ssl_fixture->force_client_auth, nullptr, - (const char**)server_alpn_protocols, num_server_alpn_protocols, + key_cert_lib->root_cert, ssl_fixture->force_client_auth, + nullptr, (const char**)server_alpn_protocols, + num_server_alpn_protocols, &ssl_fixture->server_handshaker_factory) == TSI_OK); /* Create server and client handshakers. */ tsi_handshaker* client_handshaker = nullptr; @@ -565,8 +566,8 @@ void test_tsi_ssl_client_handshaker_factory_refcounting() { tsi_ssl_client_handshaker_factory* client_handshaker_factory; GPR_ASSERT(tsi_create_ssl_client_handshaker_factory( - nullptr, cert_chain, nullptr, nullptr, 0, &client_handshaker_factory) == - TSI_OK); + nullptr, cert_chain, nullptr, nullptr, 0, + &client_handshaker_factory) == TSI_OK); handshaker_factory_destructor_called = false; original_vtable = tsi_ssl_handshaker_factory_swap_vtable( @@ -644,8 +645,8 @@ void test_tsi_ssl_client_handshaker_factory_bad_params() { tsi_ssl_client_handshaker_factory* client_handshaker_factory; GPR_ASSERT(tsi_create_ssl_client_handshaker_factory( - nullptr, cert_chain, nullptr, nullptr, 0, &client_handshaker_factory) == - TSI_INVALID_ARGUMENT); + nullptr, cert_chain, nullptr, nullptr, 0, + &client_handshaker_factory) == TSI_INVALID_ARGUMENT); tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory); } diff --git a/test/core/tsi/transport_security_test.cc b/test/core/tsi/transport_security_test.cc index 8dfe72e03b..c788ad96ad 100644 --- a/test/core/tsi/transport_security_test.cc +++ b/test/core/tsi/transport_security_test.cc @@ -90,7 +90,8 @@ const cert_name_test_entry cert_name_test_entries[] = { /* IDN tests */ {1, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br", nullptr, nullptr}, - {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, + {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, + nullptr}, {0, "xn--poema-9qae5a.com.br", "", "*.xn--poema-9qae5a.com.br," "xn--poema-*.com.br," @@ -129,8 +130,10 @@ const cert_name_test_entry cert_name_test_entries[] = { {0, "foo", "*", nullptr, nullptr}, /* IDN variants of wildcards and registry controlled domains. */ - {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, - {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", nullptr, nullptr}, + {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, + nullptr}, + {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", nullptr, + nullptr}, /* {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL}, */ @@ -177,7 +180,8 @@ const cert_name_test_entry cert_name_test_entries[] = { {1, "173.194.195.139", "foo.example.com", nullptr, "173.194.195.139"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8,8.8.4.4"}, - {1, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8,173.194.195.139"}, + {1, "173.194.195.139", "foo.example.com", nullptr, + "8.8.8.8,173.194.195.139"}, {0, "173.194.195.139", "foo.example.com", nullptr, "173.194.195.13"}, {0, "2001:db8:a0b:12f0::1", "foo.example.com", nullptr, "173.194.195.13"}, {1, "2001:db8:a0b:12f0::1", "foo.example.com", nullptr, @@ -344,25 +348,26 @@ static void test_result_strings(void) { } static void test_protector_invalid_args(void) { - GPR_ASSERT(tsi_frame_protector_protect(nullptr, nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_frame_protector_protect_flush(nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_frame_protector_unprotect(nullptr, nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_protect(nullptr, nullptr, nullptr, nullptr, + nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_protect_flush( + nullptr, nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_unprotect(nullptr, nullptr, nullptr, nullptr, + nullptr) == TSI_INVALID_ARGUMENT); } static void test_handshaker_invalid_args(void) { GPR_ASSERT(tsi_handshaker_get_result(nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_extract_peer(nullptr, nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_create_frame_protector(nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_process_bytes_from_peer(nullptr, nullptr, nullptr) == + GPR_ASSERT(tsi_handshaker_extract_peer(nullptr, nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer(nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_next(nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr) == + GPR_ASSERT(tsi_handshaker_create_frame_protector(nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_process_bytes_from_peer( + nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer( + nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_next(nullptr, nullptr, 0, nullptr, nullptr, nullptr, + nullptr, nullptr) == TSI_INVALID_ARGUMENT); } static void test_handshaker_invalid_state(void) { diff --git a/test/core/tsi/transport_security_test_lib.cc b/test/core/tsi/transport_security_test_lib.cc index 47a71717a6..3537366de9 100644 --- a/test/core/tsi/transport_security_test_lib.cc +++ b/test/core/tsi/transport_security_test_lib.cc @@ -110,7 +110,8 @@ static void check_handshake_results(tsi_test_fixture* fixture) { fixture->vtable->check_handshaker_peers(fixture); /* Check unused bytes. */ if (fixture->test_unused_bytes) { - if (fixture->server_result != nullptr && fixture->client_result != nullptr) { + if (fixture->server_result != nullptr && + fixture->client_result != nullptr) { check_unused_bytes(fixture); } fixture->bytes_written_to_server_channel = 0; @@ -145,7 +146,8 @@ static void maybe_append_unused_bytes(handshaker_args* args) { args->appended_unused_bytes = true; send_bytes_to_peer(fixture, (const unsigned char*)TSI_TEST_UNUSED_BYTES, strlen(TSI_TEST_UNUSED_BYTES), args->is_client); - if (fixture->client_result != nullptr && fixture->server_result == nullptr) { + if (fixture->client_result != nullptr && + fixture->server_result == nullptr) { fixture->has_client_finished_first = true; } } @@ -399,7 +401,8 @@ void tsi_test_do_handshake(tsi_test_fixture* fixture) { break; } GPR_ASSERT(client_args->transferred_data || server_args->transferred_data); - } while (fixture->client_result == nullptr || fixture->server_result == nullptr); + } while (fixture->client_result == nullptr || + fixture->server_result == nullptr); /* Verify handshake results. */ check_handshake_results(fixture); /* Cleanup. */ diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index aeaa38ac65..9ebb52d83e 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -203,7 +203,7 @@ static void install_crash_handler() { #define SIGNAL_NAMES_LENGTH 32 static const char* const signal_names[] = { - nullptr, "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", + nullptr, "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", diff --git a/test/core/util/trickle_endpoint.cc b/test/core/util/trickle_endpoint.cc index 63d9728600..4544fb7f49 100644 --- a/test/core/util/trickle_endpoint.cc +++ b/test/core/util/trickle_endpoint.cc @@ -53,8 +53,9 @@ static void te_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep, static void maybe_call_write_cb_locked(grpc_exec_ctx* exec_ctx, trickle_endpoint* te) { - if (te->write_cb != nullptr && (te->error != GRPC_ERROR_NONE || - te->write_buffer.length <= WRITE_BUFFER_SIZE)) { + if (te->write_cb != nullptr && + (te->error != GRPC_ERROR_NONE || + te->write_buffer.length <= WRITE_BUFFER_SIZE)) { GRPC_CLOSURE_SCHED(exec_ctx, te->write_cb, GRPC_ERROR_REF(te->error)); te->write_cb = nullptr; } diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index 894143cbc8..f8bb12fde1 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -113,7 +113,8 @@ class ClientLbEnd2endTest : public ::testing::Test { void SetNextResolution(const std::vector& ports) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_lb_addresses* addresses = grpc_lb_addresses_create(ports.size(), nullptr); + grpc_lb_addresses* addresses = + grpc_lb_addresses_create(ports.size(), nullptr); for (size_t i = 0; i < ports.size(); ++i) { char* lb_uri_str; gpr_asprintf(&lb_uri_str, "ipv4:127.0.0.1:%d", ports[i]); diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index 1cc529991e..ca846c72fd 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -264,7 +264,8 @@ static void start_lb_server(server_fixture* sf, int* ports, size_t nports, op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(203), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(203), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(203), 1); cq_verify(cqv); @@ -328,8 +329,8 @@ static void start_backend_server(server_fixture* sf) { tag(100)); GPR_ASSERT(GRPC_CALL_OK == error); gpr_log(GPR_INFO, "Server[%s] up", sf->servers_hostport); - ev = grpc_completion_queue_next(sf->cq, - grpc_timeout_seconds_to_deadline(60), nullptr); + ev = grpc_completion_queue_next( + sf->cq, grpc_timeout_seconds_to_deadline(60), nullptr); if (!ev.success) { gpr_log(GPR_INFO, "Server[%s] being torn down", sf->servers_hostport); cq_verifier_destroy(cqv); @@ -358,7 +359,8 @@ static void start_backend_server(server_fixture* sf) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); gpr_log(GPR_INFO, "Server[%s] after tag 101", sf->servers_hostport); @@ -371,7 +373,8 @@ static void start_backend_server(server_fixture* sf) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); ev = grpc_completion_queue_next( sf->cq, grpc_timeout_seconds_to_deadline(3), nullptr); @@ -400,8 +403,8 @@ static void start_backend_server(server_fixture* sf) { op->flags = 0; op->reserved = nullptr; op++; - error = - grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), nullptr); + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), + nullptr); GPR_ASSERT(GRPC_CALL_OK == error); ev = grpc_completion_queue_next( sf->cq, grpc_timeout_seconds_to_deadline(3), nullptr); @@ -434,7 +437,8 @@ static void start_backend_server(server_fixture* sf) { op->flags = 0; op->reserved = nullptr; op++; - error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); + error = + grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); CQ_EXPECT_COMPLETION(cqv, tag(101), 1); @@ -588,8 +592,8 @@ static void setup_client(const server_fixture* lb_server, grpc_fake_transport_expected_targets_arg(expected_target_names), grpc_fake_resolver_response_generator_arg(response_generator)}; - grpc_channel_args* args = - grpc_channel_args_copy_and_add(nullptr, new_args, GPR_ARRAY_SIZE(new_args)); + grpc_channel_args* args = grpc_channel_args_copy_and_add( + nullptr, new_args, GPR_ARRAY_SIZE(new_args)); gpr_free(expected_target_names); cf->cq = grpc_completion_queue_create_for_next(nullptr); diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 8102470d54..a45c577320 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -107,8 +107,8 @@ static void BM_CallCreateDestroy(benchmark::State& state) { Fixture fixture; grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); - void* method_hdl = - grpc_channel_register_call(fixture.channel(), "/foo/bar", nullptr, nullptr); + void* method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", + nullptr, nullptr); while (state.KeepRunning()) { grpc_call_unref(grpc_channel_create_registered_call( fixture.channel(), nullptr, GRPC_PROPAGATE_DEFAULTS, cq, method_hdl, @@ -708,7 +708,8 @@ class IsolatedCallFixture : public TrackCounters { grpc_channel_stack_builder_set_name(builder, "dummy"); grpc_channel_stack_builder_set_target(builder, "dummy_target"); GPR_ASSERT(grpc_channel_stack_builder_append_filter( - builder, &isolated_call_filter::isolated_call_filter, nullptr, nullptr)); + builder, &isolated_call_filter::isolated_call_filter, nullptr, + nullptr)); { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; channel_ = grpc_channel_create_with_builder(&exec_ctx, builder, @@ -735,8 +736,8 @@ class IsolatedCallFixture : public TrackCounters { static void BM_IsolatedCall_NoOp(benchmark::State& state) { IsolatedCallFixture fixture; gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); - void* method_hdl = - grpc_channel_register_call(fixture.channel(), "/foo/bar", nullptr, nullptr); + void* method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", + nullptr, nullptr); while (state.KeepRunning()) { GPR_TIMER_SCOPE("BenchmarkCycle", 0); grpc_call_unref(grpc_channel_create_registered_call( @@ -750,8 +751,8 @@ BENCHMARK(BM_IsolatedCall_NoOp); static void BM_IsolatedCall_Unary(benchmark::State& state) { IsolatedCallFixture fixture; gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); - void* method_hdl = - grpc_channel_register_call(fixture.channel(), "/foo/bar", nullptr, nullptr); + void* method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", + nullptr, nullptr); grpc_slice slice = grpc_slice_from_static_string("hello world"); grpc_byte_buffer* send_message = grpc_raw_byte_buffer_create(&slice, 1); grpc_byte_buffer* recv_message = nullptr; @@ -796,8 +797,8 @@ BENCHMARK(BM_IsolatedCall_Unary); static void BM_IsolatedCall_StreamingSend(benchmark::State& state) { IsolatedCallFixture fixture; gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); - void* method_hdl = - grpc_channel_register_call(fixture.channel(), "/foo/bar", nullptr, nullptr); + void* method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", + nullptr, nullptr); grpc_slice slice = grpc_slice_from_static_string("hello world"); grpc_byte_buffer* send_message = grpc_raw_byte_buffer_create(&slice, 1); grpc_metadata_array recv_initial_metadata; diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index e603b70889..2434d4e84e 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -305,8 +305,10 @@ static void BM_ClosureSched2OnTwoCombiners(benchmark::State& state) { grpc_combiner* combiner2 = grpc_combiner_create(); grpc_closure c1; grpc_closure c2; - GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner1)); - GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner2)); + GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, + grpc_combiner_scheduler(combiner1)); + GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, + grpc_combiner_scheduler(combiner2)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; while (state.KeepRunning()) { GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE); @@ -328,10 +330,14 @@ static void BM_ClosureSched4OnTwoCombiners(benchmark::State& state) { grpc_closure c2; grpc_closure c3; grpc_closure c4; - GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner1)); - GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner2)); - GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, grpc_combiner_scheduler(combiner1)); - GRPC_CLOSURE_INIT(&c4, DoNothing, nullptr, grpc_combiner_scheduler(combiner2)); + GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, + grpc_combiner_scheduler(combiner1)); + GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, + grpc_combiner_scheduler(combiner2)); + GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, + grpc_combiner_scheduler(combiner1)); + GRPC_CLOSURE_INIT(&c4, DoNothing, nullptr, + grpc_combiner_scheduler(combiner2)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; while (state.KeepRunning()) { GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE); diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index 343681bb9b..f0dede7333 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -59,7 +59,8 @@ static void BM_CreateDestroyCore(benchmark::State& state) { while (state.KeepRunning()) { // TODO: sreek Templatize this benchmark and pass completion type and // polling type as parameters - grpc_completion_queue_destroy(grpc_completion_queue_create_for_next(nullptr)); + grpc_completion_queue_destroy( + grpc_completion_queue_create_for_next(nullptr)); } track_counters.Finish(state); } diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc index fa9af0ac5a..02a93e90cc 100644 --- a/test/cpp/microbenchmarks/bm_error.cc +++ b/test/cpp/microbenchmarks/bm_error.cc @@ -278,8 +278,8 @@ static void BM_ErrorHttpError(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; while (state.KeepRunning()) { grpc_http2_error_code error; - grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), nullptr, - nullptr, &error); + grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), + nullptr, nullptr, &error); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc index 0a04dde15f..4da79693f1 100644 --- a/test/cpp/microbenchmarks/bm_pollset.cc +++ b/test/cpp/microbenchmarks/bm_pollset.cc @@ -145,7 +145,8 @@ static void BM_PollAddFd(benchmark::State& state) { grpc_pollset_add_fd(&exec_ctx, ps, fd); grpc_exec_ctx_flush(&exec_ctx); } - grpc_fd_orphan(&exec_ctx, fd, nullptr, nullptr, false /* already_closed */, "xxx"); + grpc_fd_orphan(&exec_ctx, fd, nullptr, nullptr, false /* already_closed */, + "xxx"); grpc_closure shutdown_ps_closure; GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps, grpc_schedule_on_exec_ctx); @@ -242,8 +243,8 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) { GRPC_ERROR_UNREF( grpc_pollset_work(&exec_ctx, ps, nullptr, GRPC_MILLIS_INF_FUTURE)); } - grpc_fd_orphan(&exec_ctx, wakeup, nullptr, nullptr, false /* already_closed */, - "done"); + grpc_fd_orphan(&exec_ctx, wakeup, nullptr, nullptr, + false /* already_closed */, "done"); wakeup_fd.read_fd = 0; grpc_closure shutdown_ps_closure; GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps, diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index 323ca1e5d7..7f1aa48b56 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -186,7 +186,8 @@ class EndpointPairFixture : public BaseFixture { grpc_server_setup_transport(&exec_ctx, server_->c_server(), server_transport_, nullptr, server_args); - grpc_chttp2_transport_start_reading(&exec_ctx, server_transport_, nullptr); + grpc_chttp2_transport_start_reading(&exec_ctx, server_transport_, + nullptr); } /* create channel */ @@ -202,7 +203,8 @@ class EndpointPairFixture : public BaseFixture { grpc_channel* channel = grpc_channel_create(&exec_ctx, "target", &c_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport_); - grpc_chttp2_transport_start_reading(&exec_ctx, client_transport_, nullptr); + grpc_chttp2_transport_start_reading(&exec_ctx, client_transport_, + nullptr); channel_ = CreateChannelInternal("", channel); } diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 9c1b4c7b73..6f1f0c44b9 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -167,7 +167,8 @@ void ArgsFinish(grpc_exec_ctx* exec_ctx, ArgsStruct* args) { grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset); grpc_pollset_set_destroy(exec_ctx, args->pollset_set); grpc_closure DoNothing_cb; - GRPC_CLOSURE_INIT(&DoNothing_cb, DoNothing, nullptr, grpc_schedule_on_exec_ctx); + GRPC_CLOSURE_INIT(&DoNothing_cb, DoNothing, nullptr, + grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(exec_ctx, args->pollset, &DoNothing_cb); // exec_ctx needs to be flushed before calling grpc_pollset_destroy() grpc_channel_args_destroy(exec_ctx, args->channel_args); diff --git a/test/cpp/util/grpc_tool_test.cc b/test/cpp/util/grpc_tool_test.cc index a8677eeba2..1c07b2a8ef 100644 --- a/test/cpp/util/grpc_tool_test.cc +++ b/test/cpp/util/grpc_tool_test.cc @@ -422,8 +422,8 @@ TEST_F(GrpcToolTest, CallCommandBatch) { // Expected output: "message: "Hello0"\nmessage: "Hello1"\nmessage: // "Hello2"\n" EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: " - "\"Hello1\"\nmessage: \"Hello2\"\n")); + "message: \"Hello0\"\nmessage: " + "\"Hello1\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -449,7 +449,7 @@ TEST_F(GrpcToolTest, CallCommandBatchWithBadRequest) { // Expected output: "message: "Hello0"\nmessage: "Hello2"\n" EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: \"Hello2\"\n")); + "message: \"Hello0\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -474,7 +474,7 @@ TEST_F(GrpcToolTest, CallCommandRequestStream) { // Expected output: "message: \"Hello0Hello1Hello2\"" EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - "message: \"Hello0Hello1Hello2\"")); + "message: \"Hello0Hello1Hello2\"")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -522,7 +522,7 @@ TEST_F(GrpcToolTest, CallCommandResponseStream) { grpc::string expected_response_text = "message: \"Hello" + grpc::to_string(i) + "\"\n"; EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - expected_response_text.c_str())); + expected_response_text.c_str())); } ShutdownServer(); @@ -548,8 +548,8 @@ TEST_F(GrpcToolTest, CallCommandBidiStream) { // Expected output: "message: \"Hello0\"\nmessage: \"Hello1\"\nmessage: // \"Hello2\"\n\n" EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: " - "\"Hello1\"\nmessage: \"Hello2\"\n")); + "message: \"Hello0\"\nmessage: " + "\"Hello1\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); } @@ -574,7 +574,7 @@ TEST_F(GrpcToolTest, CallCommandBidiStreamWithBadRequest) { // Expected output: "message: \"Hello0\"\nmessage: \"Hello1\"\nmessage: // \"Hello2\"\n\n" EXPECT_TRUE(nullptr != strstr(output_stream.str().c_str(), - "message: \"Hello0\"\nmessage: \"Hello2\"\n")); + "message: \"Hello0\"\nmessage: \"Hello2\"\n")); std::cin.rdbuf(orig); ShutdownServer(); -- cgit v1.2.3