diff options
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r-- | test/core/end2end/tests/authority_not_supported.cc (renamed from test/core/end2end/tests/authority_not_supported.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/bad_hostname.cc (renamed from test/core/end2end/tests/bad_hostname.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/tests/bad_ping.cc (renamed from test/core/end2end/tests/bad_ping.c) | 66 | ||||
-rw-r--r-- | test/core/end2end/tests/binary_metadata.cc (renamed from test/core/end2end/tests/binary_metadata.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/call_creds.cc (renamed from test/core/end2end/tests/call_creds.c) | 56 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_accept.cc (renamed from test/core/end2end/tests/cancel_after_accept.c) | 43 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_client_done.cc (renamed from test/core/end2end/tests/cancel_after_client_done.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_invoke.cc (renamed from test/core/end2end/tests/cancel_after_invoke.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_after_round_trip.cc (renamed from test/core/end2end/tests/cancel_after_round_trip.c) | 42 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_before_invoke.cc (renamed from test/core/end2end/tests/cancel_before_invoke.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_in_a_vacuum.cc (renamed from test/core/end2end/tests/cancel_in_a_vacuum.c) | 20 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_test_helpers.h | 8 | ||||
-rw-r--r-- | test/core/end2end/tests/cancel_with_status.cc (renamed from test/core/end2end/tests/cancel_with_status.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/compressed_payload.cc (renamed from test/core/end2end/tests/compressed_payload.c) | 64 | ||||
-rw-r--r-- | test/core/end2end/tests/connectivity.cc (renamed from test/core/end2end/tests/connectivity.c) | 17 | ||||
-rw-r--r-- | test/core/end2end/tests/default_host.cc (renamed from test/core/end2end/tests/default_host.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/disappearing_server.cc (renamed from test/core/end2end/tests/disappearing_server.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/tests/empty_batch.cc (renamed from test/core/end2end/tests/empty_batch.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_call_init_fails.cc (renamed from test/core/end2end/tests/filter_call_init_fails.c) | 90 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_causes_close.cc (renamed from test/core/end2end/tests/filter_causes_close.c) | 76 | ||||
-rw-r--r-- | test/core/end2end/tests/filter_latency.cc (renamed from test/core/end2end/tests/filter_latency.c) | 74 | ||||
-rw-r--r-- | test/core/end2end/tests/graceful_server_shutdown.cc (renamed from test/core/end2end/tests/graceful_server_shutdown.c) | 24 | ||||
-rw-r--r-- | test/core/end2end/tests/high_initial_seqno.cc (renamed from test/core/end2end/tests/high_initial_seqno.c) | 28 | ||||
-rw-r--r-- | test/core/end2end/tests/hpack_size.cc (renamed from test/core/end2end/tests/hpack_size.c) | 34 | ||||
-rw-r--r-- | test/core/end2end/tests/idempotent_request.cc (renamed from test/core/end2end/tests/idempotent_request.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/tests/invoke_large_request.cc (renamed from test/core/end2end/tests/invoke_large_request.c) | 38 | ||||
-rw-r--r-- | test/core/end2end/tests/keepalive_timeout.cc (renamed from test/core/end2end/tests/keepalive_timeout.c) | 56 | ||||
-rw-r--r-- | test/core/end2end/tests/large_metadata.cc (renamed from test/core/end2end/tests/large_metadata.c) | 35 | ||||
-rw-r--r-- | test/core/end2end/tests/load_reporting_hook.cc (renamed from test/core/end2end/tests/load_reporting_hook.c) | 52 | ||||
-rw-r--r-- | test/core/end2end/tests/max_concurrent_streams.cc (renamed from test/core/end2end/tests/max_concurrent_streams.c) | 64 | ||||
-rw-r--r-- | test/core/end2end/tests/max_connection_age.cc (renamed from test/core/end2end/tests/max_connection_age.c) | 70 | ||||
-rw-r--r-- | test/core/end2end/tests/max_connection_idle.cc (renamed from test/core/end2end/tests/max_connection_idle.c) | 47 | ||||
-rw-r--r-- | test/core/end2end/tests/max_message_length.cc (renamed from test/core/end2end/tests/max_message_length.c) | 104 | ||||
-rw-r--r-- | test/core/end2end/tests/negative_deadline.cc (renamed from test/core/end2end/tests/negative_deadline.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/tests/network_status_change.cc (renamed from test/core/end2end/tests/network_status_change.c) | 28 | ||||
-rw-r--r-- | test/core/end2end/tests/no_logging.cc (renamed from test/core/end2end/tests/no_logging.c) | 36 | ||||
-rw-r--r-- | test/core/end2end/tests/no_op.cc (renamed from test/core/end2end/tests/no_op.c) | 16 | ||||
-rw-r--r-- | test/core/end2end/tests/payload.cc (renamed from test/core/end2end/tests/payload.c) | 36 | ||||
-rw-r--r-- | test/core/end2end/tests/ping.cc (renamed from test/core/end2end/tests/ping.c) | 46 | ||||
-rw-r--r-- | test/core/end2end/tests/ping_pong_streaming.cc (renamed from test/core/end2end/tests/ping_pong_streaming.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/proxy_auth.cc (renamed from test/core/end2end/tests/proxy_auth.c) | 35 | ||||
-rw-r--r-- | test/core/end2end/tests/registered_call.cc (renamed from test/core/end2end/tests/registered_call.c) | 30 | ||||
-rw-r--r-- | test/core/end2end/tests/request_with_flags.cc (renamed from test/core/end2end/tests/request_with_flags.c) | 28 | ||||
-rw-r--r-- | test/core/end2end/tests/request_with_payload.cc (renamed from test/core/end2end/tests/request_with_payload.c) | 28 | ||||
-rw-r--r-- | test/core/end2end/tests/resource_quota_server.cc (renamed from test/core/end2end/tests/resource_quota_server.c) | 66 | ||||
-rw-r--r-- | test/core/end2end/tests/server_finishes_request.cc (renamed from test/core/end2end/tests/server_finishes_request.c) | 24 | ||||
-rw-r--r-- | test/core/end2end/tests/shutdown_finishes_calls.cc (renamed from test/core/end2end/tests/shutdown_finishes_calls.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/tests/shutdown_finishes_tags.cc (renamed from test/core/end2end/tests/shutdown_finishes_tags.c) | 18 | ||||
-rw-r--r-- | test/core/end2end/tests/simple_cacheable_request.cc (renamed from test/core/end2end/tests/simple_cacheable_request.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/simple_delayed_request.cc (renamed from test/core/end2end/tests/simple_delayed_request.c) | 30 | ||||
-rw-r--r-- | test/core/end2end/tests/simple_metadata.cc (renamed from test/core/end2end/tests/simple_metadata.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/simple_request.cc (renamed from test/core/end2end/tests/simple_request.c) | 34 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_compressed_payload.cc (renamed from test/core/end2end/tests/stream_compression_compressed_payload.c) | 64 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_payload.cc (renamed from test/core/end2end/tests/stream_compression_payload.c) | 41 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compression_ping_pong_streaming.cc (renamed from test/core/end2end/tests/stream_compression_ping_pong_streaming.c) | 36 | ||||
-rw-r--r-- | test/core/end2end/tests/streaming_error_response.cc (renamed from test/core/end2end/tests/streaming_error_response.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/trailing_metadata.cc (renamed from test/core/end2end/tests/trailing_metadata.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/workaround_cronet_compression.cc (renamed from test/core/end2end/tests/workaround_cronet_compression.c) | 57 | ||||
-rw-r--r-- | test/core/end2end/tests/write_buffering.cc (renamed from test/core/end2end/tests/write_buffering.c) | 32 | ||||
-rw-r--r-- | test/core/end2end/tests/write_buffering_at_end.cc (renamed from test/core/end2end/tests/write_buffering_at_end.c) | 30 |
60 files changed, 1167 insertions, 1146 deletions
diff --git a/test/core/end2end/tests/authority_not_supported.c b/test/core/end2end/tests/authority_not_supported.cc index b54d6d0d6f..62fb02ab56 100644 --- a/test/core/end2end/tests/authority_not_supported.c +++ b/test/core/end2end/tests/authority_not_supported.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,10 +86,10 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Request/response with metadata and payload.*/ static void test_with_authority_header(grpc_end2end_test_config config) { - grpc_call *c; + grpc_call* c; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"), grpc_slice_from_static_string("val1"), @@ -101,12 +101,12 @@ static void test_with_authority_header(grpc_end2end_test_config config) { {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test(config, "test_with_authority_header", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_status_code status; grpc_call_error error; grpc_slice details; diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.cc index 32093f2ecf..c54cb8ed34 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,10 +87,10 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void simple_request_body(grpc_end2end_test_fixture f) { - grpc_call *c; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.cc index 34cc8e78cd..648061587c 100644 --- a/test/core/end2end/tests/bad_ping.c +++ b/test/core/end2end/tests/bad_ping.cc @@ -31,9 +31,9 @@ #define MAX_PING_STRIKES 1 -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), @@ -41,19 +41,19 @@ static void drain_cq(grpc_completion_queue *cq) { } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_destroy(f->server); f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -65,40 +65,40 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_bad_ping(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_arg client_a[] = { - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS, - .value.integer = 10}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, - .value.integer = 0}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_BDP_PROBE, - .value.integer = 0}}; - grpc_arg server_a[] = { - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, - .value.integer = 300000 /* 5 minutes */}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MAX_PING_STRIKES, - .value.integer = MAX_PING_STRIKES}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_BDP_PROBE, - .value.integer = 0}}; - grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), - .args = client_a}; - grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), - .args = server_a}; + cq_verifier* cqv = cq_verifier_create(f.cq); + grpc_arg client_a[3]; + client_a[0].type = GRPC_ARG_INTEGER; + client_a[0].key = + const_cast<char*>(GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS); + client_a[0].value.integer = 10; + client_a[1].type = GRPC_ARG_INTEGER; + client_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA); + client_a[1].value.integer = 0; + client_a[2].type = GRPC_ARG_INTEGER; + client_a[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE); + client_a[2].value.integer = 0; + grpc_arg server_a[3]; + server_a[0].type = GRPC_ARG_INTEGER; + server_a[0].key = + const_cast<char*>(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS); + server_a[0].value.integer = 300000 /* 5 minutes */; + server_a[1].type = GRPC_ARG_INTEGER; + server_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PING_STRIKES); + server_a[1].value.integer = MAX_PING_STRIKES; + server_a[2].type = GRPC_ARG_INTEGER; + server_a[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE); + server_a[2].value.integer = 0; + grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a}; + grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a}; config.init_client(&f, &client_args); config.init_server(&f, &server_args); - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.cc index e949daee1d..52f0c70862 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,15 +87,15 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Request/response with metadata and payload.*/ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); grpc_metadata meta_c[2] = { {grpc_slice_from_static_string("key1-bin"), @@ -121,14 +121,14 @@ static void test_request_response_with_metadata_and_payload( {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.cc index 600005c9a9..fc550b7733 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.cc @@ -38,10 +38,10 @@ static const char overridden_iam_selector[] = "overridden_selector"; typedef enum { NONE, OVERRIDE, DESTROY } override_mode; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, int fail_server_auth_check) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); @@ -49,7 +49,9 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, config.init_client(&f, NULL); if (fail_server_auth_check) { grpc_arg fail_auth_arg = { - GRPC_ARG_STRING, FAIL_AUTH_CHECK_SERVER_ARG_NAME, {NULL}}; + GRPC_ARG_STRING, + const_cast<char*>(FAIL_AUTH_CHECK_SERVER_ARG_NAME), + {NULL}}; grpc_channel_args args; args.num_args = 1; args.args = &fail_auth_arg; @@ -68,14 +70,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -86,13 +88,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -102,8 +104,8 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->shutdown_cq); } -static void print_auth_context(int is_client, const grpc_auth_context *ctx) { - const grpc_auth_property *p; +static void print_auth_context(int is_client, const grpc_auth_context* ctx) { + const grpc_auth_property* p; grpc_auth_property_iterator it; gpr_log(GPR_INFO, "%s peer:", is_client ? "client" : "server"); gpr_log(GPR_INFO, "\tauthenticated: %s", @@ -120,35 +122,35 @@ static void print_auth_context(int is_client, const grpc_auth_context *ctx) { } static void request_response_with_payload_and_call_creds( - const char *test_name, grpc_end2end_test_config config, + const char* test_name, grpc_end2end_test_config config, override_mode mode) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); grpc_end2end_test_fixture f; - cq_verifier *cqv; + cq_verifier* cqv; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - grpc_call_credentials *creds = NULL; - grpc_auth_context *s_auth_context = NULL; - grpc_auth_context *c_auth_context = NULL; + grpc_call_credentials* creds = NULL; + grpc_auth_context* s_auth_context = NULL; + grpc_auth_context* c_auth_context = NULL; f = begin_test(config, test_name, 0); cqv = cq_verifier_create(f.cq); @@ -369,11 +371,11 @@ static void test_request_response_with_payload_and_deleted_call_creds( static void test_request_with_server_rejecting_client_creds( grpc_end2end_test_config config) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; + grpc_op* op; + grpc_call* c; grpc_end2end_test_fixture f; gpr_timespec deadline = five_seconds_from_now(); - cq_verifier *cqv; + cq_verifier* cqv; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -381,12 +383,12 @@ static void test_request_with_server_rejecting_client_creds( grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_call_credentials *creds; + grpc_call_credentials* creds; f = begin_test(config, "test_request_with_server_rejecting_client_creds", 1); cqv = cq_verifier_create(f.cq); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.cc index c3ac0c3201..e2ad5bd721 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -35,14 +35,14 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, cancellation_mode mode, bool use_service_config, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name, mode.name, use_service_config ? "service_config" : "client_api"); @@ -60,14 +60,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -78,13 +78,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -99,9 +99,9 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, cancellation_mode mode, bool use_service_config) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; - grpc_call *s; + grpc_op* op; + grpc_call* c; + grpc_call* s; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -109,38 +109,39 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); int was_cancelled = 2; - grpc_channel_args *args = NULL; + grpc_channel_args* args = NULL; if (use_service_config) { grpc_arg arg; arg.type = GRPC_ARG_STRING; - arg.key = GRPC_ARG_SERVICE_CONFIG; - arg.value.string = + arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG); + arg.value.string = const_cast<char*>( "{\n" " \"methodConfig\": [ {\n" " \"name\": [\n" - " { \"service\": \"service\", \"method\": \"method\" }\n" + " { \"service\": \"service\", \"method\": \"method\" },\n" + " { \"service\": \"unused\" }\n" " ],\n" " \"timeout\": \"5s\"\n" " } ]\n" - "}"; + "}"); args = grpc_channel_args_copy_and_add(args, &arg, 1); } grpc_end2end_test_fixture f = begin_test(config, "cancel_after_accept", mode, use_service_config, args, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); gpr_timespec deadline = use_service_config ? gpr_inf_future(GPR_CLOCK_MONOTONIC) diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.cc index 0e2a751d83..90db7f51b2 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.cc @@ -29,13 +29,13 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, cancellation_mode mode, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name, mode.name); @@ -53,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -71,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -91,12 +91,12 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_cancel_after_accept_and_writes_closed( grpc_end2end_test_config config, cancellation_mode mode) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; - grpc_call *s; + 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, NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -104,15 +104,15 @@ static void test_cancel_after_accept_and_writes_closed( grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); int was_cancelled = 2; diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.cc index aad9fdbf94..7f0c4e7af9 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -29,14 +29,14 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, cancellation_mode mode, size_t test_ops, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/%s [%" PRIdPTR " ops]", test_name, config.name, mode.name, test_ops); @@ -54,14 +54,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); grpc_event ev = grpc_completion_queue_next( @@ -72,13 +72,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -92,11 +92,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_cancel_after_invoke(grpc_end2end_test_config config, cancellation_mode mode, size_t test_ops) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; + grpc_op* op; + grpc_call* c; grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_invoke", mode, test_ops, NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -104,10 +104,10 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config, grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_from_now(); diff --git a/test/core/end2end/tests/cancel_after_round_trip.c b/test/core/end2end/tests/cancel_after_round_trip.cc index bc41bd3a6d..35b5214fac 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.c +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -35,14 +35,14 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, cancellation_mode mode, bool use_service_config, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name, mode.name, use_service_config ? "service_config" : "client_api"); @@ -60,14 +60,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -78,13 +78,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -99,9 +99,9 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, cancellation_mode mode, bool use_service_config) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; - grpc_call *s; + grpc_op* op; + grpc_call* c; + grpc_call* s; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -109,26 +109,26 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload1 = + grpc_byte_buffer* response_payload1 = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - grpc_byte_buffer *response_payload2 = + grpc_byte_buffer* response_payload2 = grpc_raw_byte_buffer_create(&response_payload_slice, 1); int was_cancelled = 2; - grpc_channel_args *args = NULL; + grpc_channel_args* args = NULL; if (use_service_config) { grpc_arg arg; arg.type = GRPC_ARG_STRING; - arg.key = GRPC_ARG_SERVICE_CONFIG; - arg.value.string = + arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG); + arg.value.string = const_cast<char*>( "{\n" " \"methodConfig\": [ {\n" " \"name\": [\n" @@ -136,13 +136,13 @@ static void test_cancel_after_round_trip(grpc_end2end_test_config config, " ],\n" " \"timeout\": \"5s\"\n" " } ]\n" - "}"; + "}"); 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, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); gpr_timespec deadline = use_service_config ? gpr_inf_future(GPR_CLOCK_MONOTONIC) diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.cc index 397e8b8ba6..9504aae5e6 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.cc @@ -28,13 +28,13 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, size_t num_ops, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name, config.name, num_ops); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -90,11 +90,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_cancel_before_invoke(grpc_end2end_test_config config, size_t test_ops) { grpc_op ops[6]; - grpc_op *op; - grpc_call *c; + grpc_op* op; + grpc_call* c; grpc_end2end_test_fixture f = begin_test(config, "cancel_before_invoke", test_ops, NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -102,10 +102,10 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, grpc_status_code status; grpc_call_error error; grpc_slice details; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_from_now(); diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.cc index cd9551bef9..090ee2fbb2 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.cc @@ -29,13 +29,13 @@ #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/tests/cancel_test_helpers.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, cancellation_mode mode, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name, mode.name); @@ -53,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -71,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -90,10 +90,10 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Cancel and do nothing */ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, cancellation_mode mode) { - grpc_call *c; + grpc_call* c; grpc_end2end_test_fixture f = begin_test(config, "test_cancel_in_a_vacuum", mode, NULL, NULL); - cq_verifier *v_client = cq_verifier_create(f.cq); + cq_verifier* v_client = cq_verifier_create(f.cq); gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call( diff --git a/test/core/end2end/tests/cancel_test_helpers.h b/test/core/end2end/tests/cancel_test_helpers.h index d85616b153..477d19929d 100644 --- a/test/core/end2end/tests/cancel_test_helpers.h +++ b/test/core/end2end/tests/cancel_test_helpers.h @@ -20,13 +20,13 @@ #define GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H typedef struct { - const char *name; - grpc_call_error (*initiate_cancel)(grpc_call *call, void *reserved); + const char* name; + grpc_call_error (*initiate_cancel)(grpc_call* call, void* reserved); grpc_status_code expect_status; - const char *expect_details; + const char* expect_details; } cancellation_mode; -static grpc_call_error wait_for_deadline(grpc_call *call, void *reserved) { +static grpc_call_error wait_for_deadline(grpc_call* call, void* reserved) { (void)reserved; return GRPC_CALL_OK; } diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.cc index ab8c4f4187..bc3c4c3ebd 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -31,13 +31,13 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, + const char* test_name, size_t num_ops, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name, config.name, num_ops); @@ -55,14 +55,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); grpc_event ev = grpc_completion_queue_next( @@ -73,13 +73,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -91,10 +91,10 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t num_ops) { - grpc_call *c; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_status_code status; @@ -141,9 +141,9 @@ static void simple_request_body(grpc_end2end_test_config config, error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL); GPR_ASSERT(GRPC_CALL_OK == error); - char *dynamic_string = gpr_strdup("xyz"); + char* dynamic_string = gpr_strdup("xyz"); grpc_call_cancel_with_status(c, GRPC_STATUS_UNIMPLEMENTED, - (const char *)dynamic_string, NULL); + (const char*)dynamic_string, NULL); // The API of \a description allows for it to be a dynamic/non-const // string, test this guarantee. gpr_free(dynamic_string); diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.cc index ba03773036..b5fc1898b5 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.cc @@ -36,12 +36,12 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -58,14 +58,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -76,13 +76,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -93,30 +93,30 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void request_for_disabled_algorithm( - grpc_end2end_test_config config, const char *test_name, + grpc_end2end_test_config config, const char* test_name, uint32_t send_flags_bitmask, grpc_compression_algorithm algorithm_to_disable, grpc_compression_algorithm requested_client_compression_algorithm, - grpc_status_code expected_error, grpc_metadata *client_metadata) { - grpc_call *c; - grpc_call *s; + grpc_status_code expected_error, grpc_metadata* client_metadata) { + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice; - grpc_byte_buffer *request_payload; - grpc_channel_args *client_args; - grpc_channel_args *server_args; + grpc_byte_buffer* request_payload; + grpc_channel_args* client_args; + grpc_channel_args* server_args; grpc_end2end_test_fixture f; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - cq_verifier *cqv; + cq_verifier* cqv; char str[1024]; memset(str, 'x', 1023); @@ -229,9 +229,9 @@ static void request_for_disabled_algorithm( /* with a certain error */ GPR_ASSERT(status == expected_error); - const char *algo_name = NULL; + const char* algo_name = NULL; GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name)); - char *expected_details = NULL; + char* expected_details = NULL; gpr_asprintf(&expected_details, "Compression algorithm '%s' is disabled.", algo_name); /* and we expect a specific reason for it */ @@ -268,36 +268,36 @@ static void request_for_disabled_algorithm( } static void request_with_payload_template( - grpc_end2end_test_config config, const char *test_name, + grpc_end2end_test_config config, const char* test_name, uint32_t client_send_flags_bitmask, grpc_compression_algorithm default_client_channel_compression_algorithm, grpc_compression_algorithm default_server_channel_compression_algorithm, grpc_compression_algorithm expected_algorithm_from_client, grpc_compression_algorithm expected_algorithm_from_server, - grpc_metadata *client_init_metadata, bool set_server_level, + grpc_metadata* client_init_metadata, bool set_server_level, grpc_compression_level server_compression_level, bool send_message_before_initial_metadata) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice; - grpc_byte_buffer *request_payload = NULL; - grpc_channel_args *client_args; - grpc_channel_args *server_args; + grpc_byte_buffer* request_payload = NULL; + grpc_channel_args* client_args; + grpc_channel_args* server_args; grpc_end2end_test_fixture f; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload; - grpc_byte_buffer *response_payload_recv; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload; + grpc_byte_buffer* response_payload_recv; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - cq_verifier *cqv; + cq_verifier* cqv; char request_str[1024]; char response_str[1024]; diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.cc index 610243ee3a..4f302d11dc 100644 --- a/test/core/end2end/tests/connectivity.c +++ b/test/core/end2end/tests/connectivity.cc @@ -25,18 +25,18 @@ #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } typedef struct { gpr_event started; - grpc_channel *channel; - grpc_completion_queue *cq; + grpc_channel* channel; + grpc_completion_queue* cq; } child_events; -static void child_thread(void *arg) { - child_events *ce = (child_events *)arg; +static void child_thread(void* arg) { + child_events* ce = (child_events*)arg; grpc_event ev; - gpr_event_set(&ce->started, (void *)1); + gpr_event_set(&ce->started, (void*)1); gpr_log(GPR_DEBUG, "verifying"); ev = grpc_completion_queue_next(ce->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); @@ -48,7 +48,7 @@ static void child_thread(void *arg) { static void test_connectivity(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); grpc_connectivity_state state; - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); child_events ce; gpr_thd_options thdopt = gpr_thd_options_default(); gpr_thd_id thdid; @@ -56,7 +56,8 @@ static void test_connectivity(grpc_end2end_test_config config) { grpc_channel_args client_args; grpc_arg arg_array[1]; arg_array[0].type = GRPC_ARG_INTEGER; - arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms"; + arg_array[0].key = + const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms"); arg_array[0].value.integer = 1000; client_args.args = arg_array; client_args.num_args = 1; diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.cc index d1db9b342a..166f22aec9 100644 --- a/test/core/end2end/tests/default_host.c +++ b/test/core/end2end/tests/default_host.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,11 +87,11 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void simple_request_body(grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -100,7 +100,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) { grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; + char* peer; gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.cc index 19e4c05605..a0b34dd805 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.cc @@ -28,7 +28,7 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static gpr_timespec n_seconds_from_now(int n) { return grpc_timeout_seconds_to_deadline(n); @@ -38,26 +38,26 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_destroy(f->server); f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -70,12 +70,12 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void do_request_and_shutdown_server(grpc_end2end_test_config config, - grpc_end2end_test_fixture *f, - cq_verifier *cqv) { - grpc_call *c; - grpc_call *s; + grpc_end2end_test_fixture* f, + cq_verifier* cqv) { + grpc_call* c; + grpc_call* s; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -182,7 +182,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config config, static void disappearing_server_test(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); gpr_log(GPR_INFO, "Running test: %s/%s", "disappearing_server_test", config.name); diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.cc index ee57c16780..59d0025239 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -88,10 +88,10 @@ static void end_test(grpc_end2end_test_fixture *f) { static void empty_batch_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_call_error error; - grpc_op *op = NULL; + grpc_op* op = NULL; gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call( diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.cc index 09e9dbcd7b..ecf0cc3aca 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.cc @@ -38,12 +38,12 @@ static bool g_enable_server_channel_filter = false; static bool g_enable_client_channel_filter = false; static bool g_enable_client_subchannel_filter = false; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -60,14 +60,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -78,13 +78,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -97,21 +97,21 @@ static void end_test(grpc_end2end_test_fixture *f) { // Simple request via a SERVER_CHANNEL filter that always fails to // initialize the call. static void test_server_channel_filter(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "filter_call_init_fails", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -193,21 +193,21 @@ static void test_server_channel_filter(grpc_end2end_test_config config) { // Simple request via a CLIENT_CHANNEL or CLIENT_DIRECT_CHANNEL filter // that always fails to initialize the call. static void test_client_channel_filter(grpc_end2end_test_config config) { - grpc_call *c; + grpc_call* c; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_from_now(); grpc_end2end_test_fixture f = begin_test(config, "filter_call_init_fails", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -283,21 +283,21 @@ static void test_client_channel_filter(grpc_end2end_test_config config) { // Simple request via a CLIENT_SUBCHANNEL filter that always fails to // initialize the call. static void test_client_subchannel_filter(grpc_end2end_test_config config) { - grpc_call *c; + grpc_call* c; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_from_now(); grpc_end2end_test_fixture f = begin_test(config, "filter_call_init_fails", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -399,26 +399,26 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { * Test filter - always fails to initialize a call */ -static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx, - grpc_call_element *elem, - const grpc_call_element_args *args) { +static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem, + const grpc_call_element_args* args) { return grpc_error_set_int( GRPC_ERROR_CREATE_FROM_STATIC_STRING("access denied"), GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_PERMISSION_DENIED); } -static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, - grpc_closure *ignored) {} +static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + const grpc_call_final_info* final_info, + grpc_closure* ignored) {} -static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem, - grpc_channel_element_args *args) { +static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem, + grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem) {} +static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem) {} static const grpc_channel_filter test_filter = { grpc_call_next_op, @@ -437,15 +437,15 @@ static const grpc_channel_filter test_filter = { * Registration */ -static bool maybe_add_server_channel_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, - void *arg) { +static bool maybe_add_server_channel_filter(grpc_exec_ctx* exec_ctx, + grpc_channel_stack_builder* builder, + void* arg) { if (g_enable_server_channel_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we // can't add it at the very end, because the connected channel filter // must be the last one. So we add it right before the last one. - grpc_channel_stack_builder_iterator *it = + 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( @@ -457,15 +457,15 @@ static bool maybe_add_server_channel_filter(grpc_exec_ctx *exec_ctx, } } -static bool maybe_add_client_channel_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, - void *arg) { +static bool maybe_add_client_channel_filter(grpc_exec_ctx* exec_ctx, + grpc_channel_stack_builder* builder, + void* arg) { if (g_enable_client_channel_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we // can't add it at the very end, because the connected channel filter // must be the last one. So we add it right before the last one. - grpc_channel_stack_builder_iterator *it = + 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( @@ -478,13 +478,13 @@ static bool maybe_add_client_channel_filter(grpc_exec_ctx *exec_ctx, } static bool maybe_add_client_subchannel_filter( - grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) { + grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) { if (g_enable_client_subchannel_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we // can't add it at the very end, because the client channel filter // must be the last one. So we add it right before the last one. - grpc_channel_stack_builder_iterator *it = + 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( diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.cc index ee7aeb3f33..b6cceabdd5 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.cc @@ -33,12 +33,12 @@ static bool g_enable_filter = false; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -55,14 +55,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -73,13 +73,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -91,21 +91,21 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Simple request via a server filter that always closes the stream.*/ static void test_request(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "filter_causes_close", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -189,14 +189,18 @@ static void test_request(grpc_end2end_test_config config) { * Test filter - always closes incoming requests */ -typedef struct { grpc_closure *recv_im_ready; } call_data; +typedef struct { + grpc_closure* recv_im_ready; +} call_data; -typedef struct { uint8_t unused; } channel_data; +typedef struct { + uint8_t unused; +} channel_data; -static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, - grpc_error *error) { - grpc_call_element *elem = (grpc_call_element *)arg; - call_data *calld = (call_data *)elem->call_data; +static void recv_im_ready(grpc_exec_ctx* exec_ctx, void* arg, + grpc_error* error) { + grpc_call_element* elem = (grpc_call_element*)arg; + call_data* calld = (call_data*)elem->call_data; GRPC_CLOSURE_RUN( exec_ctx, calld->recv_im_ready, grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( @@ -206,9 +210,9 @@ static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, } static void start_transport_stream_op_batch( - grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - grpc_transport_stream_op_batch *op) { - call_data *calld = (call_data *)elem->call_data; + grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + grpc_transport_stream_op_batch* op) { + call_data* calld = (call_data*)elem->call_data; if (op->recv_initial_metadata) { calld->recv_im_ready = op->payload->recv_initial_metadata.recv_initial_metadata_ready; @@ -218,24 +222,24 @@ static void start_transport_stream_op_batch( grpc_call_next_op(exec_ctx, elem, op); } -static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx, - grpc_call_element *elem, - const grpc_call_element_args *args) { +static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem, + const grpc_call_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, - grpc_closure *ignored) {} +static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, + const grpc_call_final_info* final_info, + grpc_closure* ignored) {} -static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem, - grpc_channel_element_args *args) { +static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem, + grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem) {} +static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem) {} static const grpc_channel_filter test_filter = { start_transport_stream_op_batch, @@ -254,8 +258,8 @@ static const grpc_channel_filter test_filter = { * Registration */ -static bool maybe_add_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, void *arg) { +static bool maybe_add_filter(grpc_exec_ctx* exec_ctx, + grpc_channel_stack_builder* builder, void* arg) { if (g_enable_filter) { return grpc_channel_stack_builder_prepend_filter(builder, &test_filter, NULL, NULL); diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.cc index c24934f05d..e8ec188ec3 100644 --- a/test/core/end2end/tests/filter_latency.c +++ b/test/core/end2end/tests/filter_latency.cc @@ -40,12 +40,12 @@ static gpr_mu g_mu; static gpr_timespec g_client_latency; static gpr_timespec g_server_latency; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -62,14 +62,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -80,13 +80,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -98,21 +98,21 @@ static void end_test(grpc_end2end_test_fixture *f) { // Simple request via a server filter that saves the reported latency value. static void test_request(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "filter_latency", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -247,38 +247,38 @@ static void test_request(grpc_end2end_test_config config) { * Test latency filter */ -static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx, - grpc_call_element *elem, - const grpc_call_element_args *args) { +static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem, + const grpc_call_element_args* args) { return GRPC_ERROR_NONE; } -static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx, - grpc_call_element *elem, - const grpc_call_final_info *final_info, - grpc_closure *ignored) { +static void client_destroy_call_elem(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem, + const grpc_call_final_info* final_info, + grpc_closure* ignored) { gpr_mu_lock(&g_mu); g_client_latency = final_info->stats.latency; gpr_mu_unlock(&g_mu); } -static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx, - grpc_call_element *elem, - const grpc_call_final_info *final_info, - grpc_closure *ignored) { +static void server_destroy_call_elem(grpc_exec_ctx* exec_ctx, + grpc_call_element* elem, + const grpc_call_final_info* final_info, + grpc_closure* ignored) { gpr_mu_lock(&g_mu); g_server_latency = final_info->stats.latency; gpr_mu_unlock(&g_mu); } -static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem, - grpc_channel_element_args *args) { +static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem, + grpc_channel_element_args* args) { return GRPC_ERROR_NONE; } -static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, - grpc_channel_element *elem) {} +static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, + grpc_channel_element* elem) {} static const grpc_channel_filter test_client_filter = { grpc_call_next_op, @@ -310,15 +310,15 @@ static const grpc_channel_filter test_server_filter = { * Registration */ -static bool maybe_add_filter(grpc_exec_ctx *exec_ctx, - grpc_channel_stack_builder *builder, void *arg) { - grpc_channel_filter *filter = (grpc_channel_filter *)arg; +static bool maybe_add_filter(grpc_exec_ctx* exec_ctx, + grpc_channel_stack_builder* builder, void* arg) { + grpc_channel_filter* filter = (grpc_channel_filter*)arg; if (g_enable_filter) { // Want to add the filter as close to the end as possible, to make // sure that all of the filters work well together. However, we // can't add it at the very end, because the connected channel filter // must be the last one. So we add it right before the last one. - grpc_channel_stack_builder_iterator *it = + 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 = @@ -334,13 +334,13 @@ static void init_plugin(void) { gpr_mu_init(&g_mu); grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, maybe_add_filter, - (void *)&test_client_filter); + (void*)&test_client_filter); grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX, maybe_add_filter, - (void *)&test_client_filter); + (void*)&test_client_filter); grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX, maybe_add_filter, - (void *)&test_server_filter); + (void*)&test_server_filter); } static void destroy_plugin(void) { gpr_mu_destroy(&g_mu); } diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.cc index 9b3ff98195..22bdac4032 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,26 +50,26 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_destroy(f->server); f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -82,13 +82,13 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_early_server_shutdown_finishes_inflight_calls( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.cc index 04b94838bb..72f1d0fd3d 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -32,12 +32,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -54,14 +54,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -72,13 +72,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -90,11 +90,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -208,10 +208,10 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config, grpc_end2end_test_fixture f; grpc_arg client_arg; grpc_channel_args client_args; - char *name; + char* name; client_arg.type = GRPC_ARG_INTEGER; - client_arg.key = GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER; + client_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER); client_arg.value.integer = initial_sequence_number; client_args.num_args = 1; diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.cc index 9358c119b1..b2c683ec8e 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.cc @@ -32,9 +32,9 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } -const char *hobbits[][2] = { +const char* hobbits[][2] = { {"Adaldrida", "Brandybuck"}, {"Adamanta", "Took"}, {"Adalgrim", "Took"}, {"Adelard", "Took"}, {"Amaranth", "Brandybuck"}, {"Andwise", "Roper"}, @@ -171,13 +171,13 @@ const char *hobbits[][2] = { {"Wiseman", "Gamwich"}*/ }; -const char *dragons[] = {"Ancalagon", "Glaurung", "Scatha", +const char* dragons[] = {"Ancalagon", "Glaurung", "Scatha", "Smaug the Magnificent"}; static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -194,14 +194,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -212,13 +212,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -230,11 +230,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t index) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -357,16 +357,16 @@ static void test_size(grpc_end2end_test_config config, int encode_size, grpc_channel_args server_args; grpc_arg client_arg; grpc_channel_args client_args; - char *name; + char* name; server_arg.type = GRPC_ARG_INTEGER; - server_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER; + server_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER); server_arg.value.integer = decode_size; server_args.num_args = 1; server_args.args = &server_arg; client_arg.type = GRPC_ARG_INTEGER; - client_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER; + client_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER); client_arg.value.integer = encode_size; client_args.num_args = 1; client_args.args = &client_arg; diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.cc index 829ece6631..4f61caa6df 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -88,11 +88,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -101,7 +101,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; + char* peer; gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call( diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.cc index ff269fa3ee..ade61ac91d 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.cc @@ -29,12 +29,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -47,14 +47,14 @@ static gpr_timespec n_seconds_from_now(int n) { return grpc_timeout_seconds_to_deadline(n); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, n_seconds_from_now(5), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -65,13 +65,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,17 +89,17 @@ static grpc_slice large_slice(void) { static void test_invoke_large_request(grpc_end2end_test_config config, int max_frame_size, int lookahead_bytes) { - char *name; + char* name; gpr_asprintf(&name, "test_invoke_large_request:max_frame_size=%d:lookahead_bytes=%d", max_frame_size, lookahead_bytes); grpc_arg args[2]; args[0].type = GRPC_ARG_INTEGER; - args[0].key = GRPC_ARG_HTTP2_MAX_FRAME_SIZE; + args[0].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_FRAME_SIZE); args[0].value.integer = max_frame_size; args[1].type = GRPC_ARG_INTEGER; - args[1].key = GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES; + args[1].key = const_cast<char*>(GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES); args[1].value.integer = lookahead_bytes; grpc_channel_args channel_args = {GPR_ARRAY_SIZE(args), args}; @@ -109,20 +109,20 @@ static void test_invoke_large_request(grpc_end2end_test_config config, grpc_slice request_payload_slice = large_slice(); grpc_slice response_payload_slice = large_slice(); - grpc_call *c; - grpc_call *s; - grpc_byte_buffer *request_payload = + grpc_call* c; + grpc_call* s; + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.cc index 0053368ecc..d071254a98 100644 --- a/test/core/end2end/tests/keepalive_timeout.c +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -32,12 +32,12 @@ #include "src/core/lib/support/env.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "%s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -54,14 +54,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); @@ -72,13 +72,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -91,35 +91,35 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request, server replies with a payload, then waits for the keepalive watchdog timeouts before returning status. */ static void test_keepalive_timeout(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - grpc_arg keepalive_arg_elems[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_KEEPALIVE_TIME_MS, - .value.integer = 1500}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_KEEPALIVE_TIMEOUT_MS, - .value.integer = 0}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_BDP_PROBE, - .value.integer = 0}}; - grpc_channel_args keepalive_args = { - .num_args = GPR_ARRAY_SIZE(keepalive_arg_elems), - .args = keepalive_arg_elems}; + grpc_arg keepalive_arg_elems[3]; + keepalive_arg_elems[0].type = GRPC_ARG_INTEGER; + keepalive_arg_elems[0].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS); + keepalive_arg_elems[0].value.integer = 1500; + keepalive_arg_elems[1].type = GRPC_ARG_INTEGER; + keepalive_arg_elems[1].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_TIMEOUT_MS); + keepalive_arg_elems[1].value.integer = 0; + keepalive_arg_elems[2].type = GRPC_ARG_INTEGER; + keepalive_arg_elems[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE); + keepalive_arg_elems[2].value.integer = 0; + grpc_channel_args keepalive_args = {GPR_ARRAY_SIZE(keepalive_arg_elems), + keepalive_arg_elems}; grpc_end2end_test_fixture f = begin_test(config, "keepalive_timeout", &keepalive_args, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -191,8 +191,8 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { CQ_EXPECT_COMPLETION(cqv, tag(3), 1); cq_verify(cqv); - char *details_str = grpc_slice_to_c_string(details); - char *method_str = grpc_slice_to_c_string(call_details.method); + char* details_str = grpc_slice_to_c_string(details); + char* method_str = grpc_slice_to_c_string(call_details.method); GPR_ASSERT(status == GRPC_STATUS_INTERNAL); GPR_ASSERT(0 == grpc_slice_str_cmp(details, "keepalive watchdog timeout")); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.cc index 81a45d827a..4afd9f31ba 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,27 +86,28 @@ static void end_test(grpc_end2end_test_fixture *f) { // Request with a large amount of metadata. static void test_request_with_large_metadata(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_metadata meta; const size_t large_size = 64 * 1024; - grpc_arg arg = {GRPC_ARG_INTEGER, - GRPC_ARG_MAX_METADATA_SIZE, - {.integer = (int)large_size + 1024}}; + grpc_arg arg; + arg.type = GRPC_ARG_INTEGER; + arg.key = const_cast<char*>(GRPC_ARG_MAX_METADATA_SIZE); + arg.value.integer = (int)large_size + 1024; grpc_channel_args args = {1, &arg}; grpc_end2end_test_fixture f = begin_test(config, "test_request_with_large_metadata", &args, &args); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.cc index 7b503790db..5c2c3b497c 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.cc @@ -36,16 +36,16 @@ enum { TIMEOUT = 200000 }; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } typedef struct { gpr_mu mu; intptr_t channel_id; intptr_t call_id; - char *initial_md_str; - char *trailing_md_str; - char *method_name; + char* initial_md_str; + char* trailing_md_str; + char* method_name; uint64_t incoming_bytes; uint64_t outgoing_bytes; @@ -56,9 +56,9 @@ typedef struct { } load_reporting_data; static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); @@ -77,14 +77,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -95,13 +95,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -113,25 +113,25 @@ static void end_test(grpc_end2end_test_fixture *f) { static void request_response_with_payload( grpc_end2end_test_config config, grpc_end2end_test_fixture f, - const char *method_name, const char *request_msg, const char *response_msg, - grpc_metadata *initial_lr_metadata, grpc_metadata *trailing_lr_metadata) { + const char* method_name, const char* request_msg, const char* response_msg, + grpc_metadata* initial_lr_metadata, grpc_metadata* trailing_lr_metadata) { grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg); grpc_slice response_payload_slice = grpc_slice_from_static_string(response_msg); - grpc_call *c; - grpc_call *s; - grpc_byte_buffer *request_payload = + grpc_call* c; + grpc_call* s; + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -264,7 +264,7 @@ static void request_response_with_payload( /* override the default for testing purposes */ extern void (*g_load_reporting_fn)( - const grpc_load_reporting_call_data *call_data); + const grpc_load_reporting_call_data* call_data); static void test_load_reporting_hook(grpc_end2end_test_config config) { /* TODO(dgq): this test is currently a noop until LR is fully defined. @@ -272,15 +272,15 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { /* Introduce load reporting for the server through its arguments */ grpc_arg arg = grpc_load_reporting_enable_arg(); - grpc_channel_args *lr_server_args = + grpc_channel_args* lr_server_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); grpc_end2end_test_fixture f = begin_test(config, "test_load_reporting_hook", NULL, lr_server_args); - const char *method_name = "/gRPCFTW"; - const char *request_msg = "the msg from the client"; - const char *response_msg = "... and the response from the server"; + const char* method_name = "/gRPCFTW"; + const char* request_msg = "the msg from the client"; + const char* response_msg = "... and the response from the server"; grpc_metadata initial_lr_metadata; grpc_metadata trailing_lr_metadata; diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.cc index d18c13997c..b8b49d65fb 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,11 +86,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -196,13 +196,13 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { grpc_end2end_test_fixture f; grpc_arg server_arg; grpc_channel_args server_args; - grpc_call *c1; - grpc_call *c2; - grpc_call *s1; - grpc_call *s2; + grpc_call* c1; + grpc_call* c2; + grpc_call* s1; + grpc_call* s2; int live_call; gpr_timespec deadline; - cq_verifier *cqv; + cq_verifier* cqv; grpc_event ev; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; @@ -216,12 +216,12 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { grpc_status_code status2; grpc_slice details2; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; int was_cancelled; int got_client_start; int got_server_start; - server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS; + server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS); server_arg.type = GRPC_ARG_INTEGER; server_arg.value.integer = 1; @@ -441,11 +441,11 @@ static void test_max_concurrent_streams_with_timeout_on_first( grpc_end2end_test_fixture f; grpc_arg server_arg; grpc_channel_args server_args; - grpc_call *c1; - grpc_call *c2; - grpc_call *s1; - grpc_call *s2; - cq_verifier *cqv; + grpc_call* c1; + grpc_call* c2; + grpc_call* s1; + grpc_call* s2; + cq_verifier* cqv; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; grpc_metadata_array initial_metadata_recv1; @@ -458,10 +458,10 @@ static void test_max_concurrent_streams_with_timeout_on_first( grpc_status_code status2; grpc_slice details2 = grpc_empty_slice(); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; int was_cancelled; - server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS; + server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS); server_arg.type = GRPC_ARG_INTEGER; server_arg.value.integer = 1; @@ -636,10 +636,10 @@ static void test_max_concurrent_streams_with_timeout_on_second( grpc_end2end_test_fixture f; grpc_arg server_arg; grpc_channel_args server_args; - grpc_call *c1; - grpc_call *c2; - grpc_call *s1; - cq_verifier *cqv; + grpc_call* c1; + grpc_call* c2; + grpc_call* s1; + cq_verifier* cqv; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; grpc_metadata_array initial_metadata_recv1; @@ -652,10 +652,10 @@ static void test_max_concurrent_streams_with_timeout_on_second( grpc_status_code status2; grpc_slice details2 = grpc_empty_slice(); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; int was_cancelled; - server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS; + server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS); server_arg.type = GRPC_ARG_INTEGER; server_arg.value.integer = 1; diff --git a/test/core/end2end/tests/max_connection_age.c b/test/core/end2end/tests/max_connection_age.cc index b6daa59d7b..b5d4dcf963 100644 --- a/test/core/end2end/tests/max_connection_age.c +++ b/test/core/end2end/tests/max_connection_age.cc @@ -45,9 +45,9 @@ /* The grace period for the test to observe the channel shutdown process */ #define IMMEDIATE_SHUTDOWN_GRACE_TIME_MS 3000 -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), @@ -55,19 +55,19 @@ static void drain_cq(grpc_completion_queue *cq) { } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_destroy(f->server); f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -79,27 +79,27 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_max_age_forcibly_close(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_AGE_MS, - .value.integer = MAX_CONNECTION_AGE_MS}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS, - .value.integer = MAX_CONNECTION_AGE_GRACE_MS}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS, - .value.integer = MAX_CONNECTION_IDLE_MS}}; - grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), - .args = server_a}; + cq_verifier* cqv = cq_verifier_create(f.cq); + grpc_arg server_a[3]; + server_a[0].type = GRPC_ARG_INTEGER; + server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS); + server_a[0].value.integer = MAX_CONNECTION_AGE_MS; + server_a[1].type = GRPC_ARG_INTEGER; + server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS); + server_a[1].value.integer = MAX_CONNECTION_AGE_GRACE_MS; + server_a[2].type = GRPC_ARG_INTEGER; + server_a[2].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS); + server_a[2].value.integer = MAX_CONNECTION_IDLE_MS; + grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a}; config.init_client(&f, NULL); config.init_server(&f, &server_args); - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -222,27 +222,27 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { static void test_max_age_gracefully_close(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_AGE_MS, - .value.integer = MAX_CONNECTION_AGE_MS}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS, - .value.integer = INT_MAX}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS, - .value.integer = MAX_CONNECTION_IDLE_MS}}; - grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), - .args = server_a}; + cq_verifier* cqv = cq_verifier_create(f.cq); + grpc_arg server_a[3]; + server_a[0].type = GRPC_ARG_INTEGER; + server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS); + server_a[0].value.integer = MAX_CONNECTION_AGE_MS; + server_a[1].type = GRPC_ARG_INTEGER; + server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS); + server_a[1].value.integer = INT_MAX; + server_a[2].type = GRPC_ARG_INTEGER; + server_a[2].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS); + server_a[2].value.integer = MAX_CONNECTION_IDLE_MS; + grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a}; config.init_client(&f, NULL); config.init_server(&f, &server_args); - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/max_connection_idle.c b/test/core/end2end/tests/max_connection_idle.cc index f26b0be40e..d850e4267b 100644 --- a/test/core/end2end/tests/max_connection_idle.c +++ b/test/core/end2end/tests/max_connection_idle.cc @@ -32,9 +32,9 @@ #define MAX_CONNECTION_IDLE_MS 500 #define MAX_CONNECTION_AGE_MS 9999 -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), @@ -43,12 +43,12 @@ static void drain_cq(grpc_completion_queue *cq) { } static void simple_request_body(grpc_end2end_test_config config, - grpc_end2end_test_fixture *f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f->cq); + grpc_end2end_test_fixture* f) { + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f->cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -57,7 +57,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; + char* peer; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); c = grpc_channel_create_call( @@ -169,21 +169,22 @@ static void simple_request_body(grpc_end2end_test_config config, static void test_max_connection_idle(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); grpc_connectivity_state state = GRPC_CHANNEL_IDLE; - cq_verifier *cqv = cq_verifier_create(f.cq); - - grpc_arg client_a[] = {{.type = GRPC_ARG_INTEGER, - .key = "grpc.testing.fixed_reconnect_backoff_ms", - .value.integer = 1000}}; - grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS, - .value.integer = MAX_CONNECTION_IDLE_MS}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_MAX_CONNECTION_AGE_MS, - .value.integer = MAX_CONNECTION_AGE_MS}}; - grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), - .args = client_a}; - grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), - .args = server_a}; + cq_verifier* cqv = cq_verifier_create(f.cq); + + grpc_arg client_a[1]; + client_a[0].type = GRPC_ARG_INTEGER; + client_a[0].key = + const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms"); + client_a[0].value.integer = 1000; + grpc_arg server_a[2]; + server_a[0].type = GRPC_ARG_INTEGER; + server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS); + server_a[0].value.integer = MAX_CONNECTION_IDLE_MS; + server_a[1].type = GRPC_ARG_INTEGER; + server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS); + server_a[1].value.integer = MAX_CONNECTION_AGE_MS; + grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a}; + grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a}; config.init_client(&f, &client_args); config.init_server(&f, &server_args); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.cc index 01eb8d365e..3d677f1d8f 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.cc @@ -34,12 +34,12 @@ #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); // We intentionally do not pass the client and server args to @@ -59,14 +59,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); grpc_event ev = grpc_completion_queue_next( @@ -77,13 +77,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -106,16 +106,16 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, send_limit, use_service_config, use_string_json_value); grpc_end2end_test_fixture f; - grpc_call *c = NULL; - grpc_call *s = NULL; - cq_verifier *cqv; + grpc_call* c = NULL; + grpc_call* s = NULL; + cq_verifier* cqv; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *recv_payload = NULL; + grpc_byte_buffer* recv_payload = NULL; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -125,41 +125,44 @@ static void test_max_message_length_on_request(grpc_end2end_test_config config, grpc_slice details; int was_cancelled = 2; - grpc_channel_args *client_args = NULL; - grpc_channel_args *server_args = NULL; + grpc_channel_args* client_args = NULL; + grpc_channel_args* server_args = NULL; if (use_service_config) { // We don't currently support service configs on the server side. GPR_ASSERT(send_limit); grpc_arg arg; arg.type = GRPC_ARG_STRING; - arg.key = GRPC_ARG_SERVICE_CONFIG; + arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG); arg.value.string = use_string_json_value - ? "{\n" - " \"methodConfig\": [ {\n" - " \"name\": [\n" - " { \"service\": \"service\", \"method\": \"method\" }\n" - " ],\n" - " \"maxRequestMessageBytes\": \"5\"\n" - " } ]\n" - "}" - : "{\n" - " \"methodConfig\": [ {\n" - " \"name\": [\n" - " { \"service\": \"service\", \"method\": \"method\" }\n" - " ],\n" - " \"maxRequestMessageBytes\": 5\n" - " } ]\n" - "}"; + ? const_cast<char*>( + "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxRequestMessageBytes\": \"5\"\n" + " } ]\n" + "}") + : const_cast<char*>( + "{\n" + " \"methodConfig\": [ {\n" + " \"name\": [\n" + " { \"service\": \"service\", \"method\": \"method\" }\n" + " ],\n" + " \"maxRequestMessageBytes\": 5\n" + " } ]\n" + "}"); client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); } else { // Set limit via channel args. grpc_arg arg; - arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH - : GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH; + arg.key = send_limit + ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) + : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH); arg.type = GRPC_ARG_INTEGER; arg.value.integer = 5; - grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1); + grpc_channel_args* args = grpc_channel_args_copy_and_add(NULL, &arg, 1); if (send_limit) { client_args = args; } else { @@ -296,16 +299,16 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, send_limit, use_service_config, use_string_json_value); grpc_end2end_test_fixture f; - grpc_call *c = NULL; - grpc_call *s = NULL; - cq_verifier *cqv; + grpc_call* c = NULL; + grpc_call* s = NULL; + cq_verifier* cqv; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - grpc_byte_buffer *recv_payload = NULL; + grpc_byte_buffer* recv_payload = NULL; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -315,15 +318,15 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, grpc_slice details; int was_cancelled = 2; - grpc_channel_args *client_args = NULL; - grpc_channel_args *server_args = NULL; + grpc_channel_args* client_args = NULL; + grpc_channel_args* server_args = NULL; if (use_service_config) { // We don't currently support service configs on the server side. GPR_ASSERT(!send_limit); grpc_arg arg; arg.type = GRPC_ARG_STRING; - arg.key = GRPC_ARG_SERVICE_CONFIG; - arg.value.string = + arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG); + arg.value.string = const_cast<char*>( use_string_json_value ? "{\n" " \"methodConfig\": [ {\n" @@ -340,16 +343,17 @@ static void test_max_message_length_on_response(grpc_end2end_test_config config, " ],\n" " \"maxResponseMessageBytes\": 5\n" " } ]\n" - "}"; + "}"); client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); } else { // Set limit via channel args. grpc_arg arg; - arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH - : GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH; + arg.key = send_limit + ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) + : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH); arg.type = GRPC_ARG_INTEGER; arg.value.integer = 5; - grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1); + grpc_channel_args* args = grpc_channel_args_copy_and_add(NULL, &arg, 1); if (send_limit) { server_args = args; } else { diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.cc index c8667f4f4d..0d56038684 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -88,10 +88,10 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f, size_t num_ops) { - grpc_call *c; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_status_code status; diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.cc index 4d77174e22..088563cb2c 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.cc @@ -31,12 +31,12 @@ /* this is a private API but exposed here for testing*/ extern void grpc_network_status_shutdown_all_endpoints(); -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -53,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(500); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -71,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,21 +89,21 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request with payload, server reads then returns status. */ static void test_invoke_network_status_change(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.cc index f7d50c24dd..1a7b57cd84 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.cc @@ -34,12 +34,12 @@ enum { TIMEOUT = 200000 }; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } -extern void gpr_default_log(gpr_log_func_args *args); +extern "C" void gpr_default_log(gpr_log_func_args* args); -static void test_no_log(gpr_log_func_args *args) { - char *message = NULL; +static void test_no_log(gpr_log_func_args* args) { + char* message = NULL; gpr_asprintf(&message, "Unwanted log: %s", args->message); args->message = message; gpr_default_log(args); @@ -47,7 +47,7 @@ static void test_no_log(gpr_log_func_args *args) { abort(); } -static void test_no_error_log(gpr_log_func_args *args) { +static void test_no_error_log(gpr_log_func_args* args) { if (args->severity == GPR_LOG_SEVERITY_ERROR) { test_no_log(args); } @@ -55,15 +55,15 @@ static void test_no_error_log(gpr_log_func_args *args) { static gpr_atm g_log_func = (gpr_atm)gpr_default_log; -static void log_dispatcher_func(gpr_log_func_args *args) { +static void log_dispatcher_func(gpr_log_func_args* args) { gpr_log_func log_func = (gpr_log_func)gpr_atm_no_barrier_load(&g_log_func); log_func(args); } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -80,14 +80,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -98,13 +98,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -116,11 +116,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -129,7 +129,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; + char* peer; gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call( diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.cc index 8400c27486..98cf5eb9dc 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.cc index d98eed68e0..0ff9461a47 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,9 +89,9 @@ static void end_test(grpc_end2end_test_fixture *f) { static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; - char *output; + char* output; const size_t output_size = 1024 * 1024; - output = (char *)gpr_malloc(output_size); + output = (char*)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } @@ -109,20 +109,20 @@ static void request_response_with_payload(grpc_end2end_test_config config, grpc_slice request_payload_slice = generate_random_slice(); grpc_slice response_payload_slice = generate_random_slice(); - grpc_call *c; - grpc_call *s; - grpc_byte_buffer *request_payload = + grpc_call* c; + grpc_call* s; + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.cc index 23c82569ba..88f62c0a2b 100644 --- a/test/core/end2end/tests/ping.c +++ b/test/core/end2end/tests/ping.cc @@ -28,36 +28,36 @@ #define PING_NUM 5 -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static void test_ping(grpc_end2end_test_config config, int min_time_between_pings_ms) { grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_connectivity_state state = GRPC_CHANNEL_IDLE; int i; - grpc_arg client_a[] = { - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS, - .value.integer = 10}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, - .value.integer = 0}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, - .value.integer = 1}}; - grpc_arg server_a[] = { - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, - .value.integer = 0}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, - .value.integer = 1}}; - grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), - .args = client_a}; - grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), - .args = server_a}; + grpc_arg client_a[3]; + client_a[0].type = GRPC_ARG_INTEGER; + client_a[0].key = + const_cast<char*>(GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS); + client_a[0].value.integer = 10; + client_a[1].type = GRPC_ARG_INTEGER; + client_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA); + client_a[1].value.integer = 0; + client_a[2].type = GRPC_ARG_INTEGER; + client_a[2].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS); + client_a[2].value.integer = 1; + grpc_arg server_a[2]; + server_a[0].type = GRPC_ARG_INTEGER; + server_a[0].key = + const_cast<char*>(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS); + server_a[0].value.integer = 0; + server_a[1].type = GRPC_ARG_INTEGER; + server_a[1].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS); + server_a[1].value.integer = 1; + grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a}; + grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a}; config.init_client(&f, &client_args); config.init_server(&f, &server_args); diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.cc index 1c44262c3d..3c2e76b9f9 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,11 +89,11 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, int messages) { grpc_end2end_test_fixture f = begin_test(config, "test_pingpong_streaming", NULL, NULL); - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -102,10 +102,10 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - grpc_byte_buffer *request_payload; - grpc_byte_buffer *request_payload_recv; - grpc_byte_buffer *response_payload; - grpc_byte_buffer *response_payload_recv; + grpc_byte_buffer* request_payload; + grpc_byte_buffer* request_payload_recv; + grpc_byte_buffer* response_payload; + grpc_byte_buffer* response_payload_recv; int i; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); diff --git a/test/core/end2end/tests/proxy_auth.c b/test/core/end2end/tests/proxy_auth.cc index d922049bcb..d5dce7c6de 100644 --- a/test/core/end2end/tests/proxy_auth.c +++ b/test/core/end2end/tests/proxy_auth.cc @@ -35,12 +35,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -57,14 +57,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -75,13 +75,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -93,11 +93,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -106,7 +106,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; + char* peer; gpr_timespec deadline = five_seconds_from_now(); c = grpc_channel_create_call( @@ -217,10 +217,11 @@ static void simple_request_body(grpc_end2end_test_config config, static void test_invoke_proxy_auth(grpc_end2end_test_config config) { /* Indicate that the proxy requires user auth */ - grpc_arg client_arg = {.type = GRPC_ARG_STRING, - .key = GRPC_ARG_HTTP_PROXY_AUTH_CREDS, - .value.string = GRPC_TEST_HTTP_PROXY_AUTH_CREDS}; - grpc_channel_args client_args = {.num_args = 1, .args = &client_arg}; + grpc_arg client_arg; + client_arg.type = GRPC_ARG_STRING; + client_arg.key = const_cast<char*>(GRPC_ARG_HTTP_PROXY_AUTH_CREDS); + client_arg.value.string = const_cast<char*>(GRPC_TEST_HTTP_PROXY_AUTH_CREDS); + grpc_channel_args client_args = {1, &client_arg}; grpc_end2end_test_fixture f = begin_test(config, "test_invoke_proxy_auth", &client_args, NULL); simple_request_body(config, f); diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.cc index 4598029818..b43ca04766 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,12 +87,12 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void simple_request_body(grpc_end2end_test_config config, - grpc_end2end_test_fixture f, void *rc) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_end2end_test_fixture f, void* rc) { + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -194,7 +194,7 @@ static void simple_request_body(grpc_end2end_test_config config, static void test_invoke_simple_request(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "test_invoke_simple_request", NULL, NULL); - void *rc = grpc_channel_register_call( + void* rc = grpc_channel_register_call( f.client, "/foo", get_host_override_string("foo.test.google.fr:1234", config), NULL); @@ -207,7 +207,7 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) { int i; grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL); - void *rc = grpc_channel_register_call( + void* rc = grpc_channel_register_call( f.client, "/foo", get_host_override_string("foo.test.google.fr:1234", config), NULL); diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.cc index dfb7d58743..77c931844c 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.cc @@ -29,12 +29,12 @@ #include "src/core/lib/transport/byte_stream.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -51,14 +51,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -69,13 +69,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,22 +86,22 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void test_invoke_request_with_flags( - grpc_end2end_test_config config, uint32_t *flags_for_op, + grpc_end2end_test_config config, uint32_t* flags_for_op, grpc_call_error call_start_batch_expected_result) { - grpc_call *c; + grpc_call* c; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_flags", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.cc index 575e54c7d9..946144239c 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,21 +86,21 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request with payload, server reads then returns status. */ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.cc index 93befeee0c..dd00c9843f 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,9 +89,9 @@ static void end_test(grpc_end2end_test_fixture *f) { static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; - char *output; + char* output; const size_t output_size = 1024 * 1024; - output = (char *)gpr_malloc(output_size); + output = (char*)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } @@ -106,7 +106,7 @@ void resource_quota_server(grpc_end2end_test_config config) { FEATURE_MASK_DOES_NOT_SUPPORT_RESOURCE_QUOTA_SERVER) { return; } - grpc_resource_quota *resource_quota = + grpc_resource_quota* resource_quota = grpc_resource_quota_create("test_server"); grpc_resource_quota_resize(resource_quota, 5 * 1024 * 1024); @@ -117,7 +117,7 @@ void resource_quota_server(grpc_end2end_test_config config) { #define SERVER_END_BASE_TAG 0x4000 grpc_arg arg; - arg.key = GRPC_ARG_RESOURCE_QUOTA; + arg.key = const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA); arg.type = GRPC_ARG_POINTER; arg.value.pointer.p = resource_quota; arg.value.pointer.vtable = grpc_resource_quota_arg_vtable(); @@ -131,26 +131,26 @@ void resource_quota_server(grpc_end2end_test_config config) { * will be verified on completion. */ grpc_slice request_payload_slice = generate_random_slice(); - grpc_call **client_calls = - (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS); - grpc_call **server_calls = - (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS); - grpc_metadata_array *initial_metadata_recv = - (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); - grpc_metadata_array *trailing_metadata_recv = - (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); - grpc_metadata_array *request_metadata_recv = - (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); - grpc_call_details *call_details = - (grpc_call_details *)malloc(sizeof(grpc_call_details) * NUM_CALLS); - grpc_status_code *status = - (grpc_status_code *)malloc(sizeof(grpc_status_code) * NUM_CALLS); - grpc_slice *details = (grpc_slice *)malloc(sizeof(grpc_slice) * NUM_CALLS); - grpc_byte_buffer **request_payload = - (grpc_byte_buffer **)malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS); - grpc_byte_buffer **request_payload_recv = - (grpc_byte_buffer **)malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS); - int *was_cancelled = (int *)malloc(sizeof(int) * NUM_CALLS); + grpc_call** client_calls = + (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS); + grpc_call** server_calls = + (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS); + grpc_metadata_array* initial_metadata_recv = + (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_metadata_array* trailing_metadata_recv = + (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_metadata_array* request_metadata_recv = + (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS); + grpc_call_details* call_details = + (grpc_call_details*)malloc(sizeof(grpc_call_details) * NUM_CALLS); + grpc_status_code* status = + (grpc_status_code*)malloc(sizeof(grpc_status_code) * NUM_CALLS); + grpc_slice* details = (grpc_slice*)malloc(sizeof(grpc_slice) * NUM_CALLS); + grpc_byte_buffer** request_payload = + (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS); + grpc_byte_buffer** request_payload_recv = + (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS); + int* was_cancelled = (int*)malloc(sizeof(int) * NUM_CALLS); grpc_call_error error; int pending_client_calls = 0; int pending_server_start_calls = 0; @@ -162,7 +162,7 @@ void resource_quota_server(grpc_end2end_test_config config) { int unavailable = 0; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; for (int i = 0; i < NUM_CALLS; i++) { grpc_metadata_array_init(&initial_metadata_recv[i]); diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.cc index 49b9f27396..50544a6759 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.cc @@ -30,12 +30,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -88,11 +88,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.cc index f90359f09a..26a53e5161 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,20 +50,20 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_client(f); grpc_completion_queue_shutdown(f->cq); @@ -75,13 +75,13 @@ static void end_test(grpc_end2end_test_fixture *f) { static void test_early_server_shutdown_finishes_inflight_calls( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.cc index 7914cc95ba..0275a1e4ef 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.c +++ b/test/core/end2end/tests/shutdown_finishes_tags.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,20 +50,20 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_client(f); grpc_completion_queue_shutdown(f->cq); @@ -77,8 +77,8 @@ static void test_early_server_shutdown_finishes_tags( grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test( config, "test_early_server_shutdown_finishes_tags", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); - grpc_call *s = (grpc_call *)(uintptr_t)1; + cq_verifier* cqv = cq_verifier_create(f.cq); + grpc_call* s = (grpc_call*)(uintptr_t)1; grpc_call_details call_details; grpc_metadata_array request_metadata_recv; diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.cc index faa5c193dc..e2ee7bf35a 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.cc @@ -30,12 +30,12 @@ enum { TIMEOUT = 200000 }; -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -52,14 +52,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -70,13 +70,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,15 +89,15 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Request/response with metadata and payload.*/ static void test_cacheable_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"), grpc_slice_from_static_string("val1"), @@ -118,14 +118,14 @@ static void test_cacheable_request_response_with_metadata_and_payload( grpc_end2end_test_fixture f = begin_test( config, "test_cacheable_request_response_with_metadata_and_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.cc index c3f66a07aa..eef36c9710 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.cc @@ -28,7 +28,7 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static gpr_timespec n_seconds_from_now(int n) { return grpc_timeout_seconds_to_deadline(n); @@ -38,14 +38,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -56,13 +56,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -73,15 +73,15 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void simple_delayed_request_body(grpc_end2end_test_config config, - grpc_end2end_test_fixture *f, - grpc_channel_args *client_args, - grpc_channel_args *server_args, + grpc_end2end_test_fixture* f, + grpc_channel_args* client_args, + grpc_channel_args* server_args, long delay_us) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f->cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f->cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -191,7 +191,8 @@ static void test_simple_delayed_request_short(grpc_end2end_test_config config) { grpc_channel_args client_args; grpc_arg arg_array[1]; arg_array[0].type = GRPC_ARG_INTEGER; - arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms"; + arg_array[0].key = + const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms"); arg_array[0].value.integer = 1000; client_args.args = arg_array; client_args.num_args = 1; @@ -210,7 +211,8 @@ static void test_simple_delayed_request_long(grpc_end2end_test_config config) { grpc_channel_args client_args; grpc_arg arg_array[1]; arg_array[0].type = GRPC_ARG_INTEGER; - arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms"; + arg_array[0].key = + const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms"); arg_array[0].value.integer = 1000; client_args.args = arg_array; client_args.num_args = 1; diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.cc index 17e7f696e2..3b3d5ad64c 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,15 +87,15 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Request/response with metadata and payload.*/ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"), grpc_slice_from_static_string("val1"), @@ -115,14 +115,14 @@ static void test_request_response_with_metadata_and_payload( {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.cc index 7ce7e1f285..d48010ba87 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.cc @@ -31,12 +31,12 @@ #include "src/core/lib/support/string.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -53,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -71,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -89,11 +89,11 @@ static void end_test(grpc_end2end_test_fixture *f) { static void simple_request_body(grpc_end2end_test_config config, grpc_end2end_test_fixture f) { - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -102,9 +102,11 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - char *peer; - grpc_stats_data *before = gpr_malloc(sizeof(grpc_stats_data)); - grpc_stats_data *after = gpr_malloc(sizeof(grpc_stats_data)); + char* peer; + grpc_stats_data* before = + static_cast<grpc_stats_data*>(gpr_malloc(sizeof(grpc_stats_data))); + grpc_stats_data* after = + static_cast<grpc_stats_data*>(gpr_malloc(sizeof(grpc_stats_data))); grpc_stats_collect(before); @@ -216,7 +218,7 @@ static void simple_request_body(grpc_end2end_test_config config, grpc_stats_collect(after); - char *stats = grpc_stats_data_as_json(after); + char* stats = grpc_stats_data_as_json(after); gpr_log(GPR_DEBUG, "%s", stats); gpr_free(stats); diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.c b/test/core/end2end/tests/stream_compression_compressed_payload.cc index 8b47741cd4..3fe5200045 100644 --- a/test/core/end2end/tests/stream_compression_compressed_payload.c +++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc @@ -36,12 +36,12 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -58,14 +58,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -76,13 +76,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -93,30 +93,30 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void request_for_disabled_algorithm( - grpc_end2end_test_config config, const char *test_name, + grpc_end2end_test_config config, const char* test_name, uint32_t send_flags_bitmask, grpc_stream_compression_algorithm algorithm_to_disable, grpc_stream_compression_algorithm requested_client_compression_algorithm, - grpc_status_code expected_error, grpc_metadata *client_metadata) { - grpc_call *c; - grpc_call *s; + grpc_status_code expected_error, grpc_metadata* client_metadata) { + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice; - grpc_byte_buffer *request_payload; - grpc_channel_args *client_args; - grpc_channel_args *server_args; + grpc_byte_buffer* request_payload; + grpc_channel_args* client_args; + grpc_channel_args* server_args; grpc_end2end_test_fixture f; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - cq_verifier *cqv; + cq_verifier* cqv; char str[1024]; memset(str, 'x', 1023); @@ -229,10 +229,10 @@ static void request_for_disabled_algorithm( /* with a certain error */ GPR_ASSERT(status == expected_error); - const char *algo_name = NULL; + const char* algo_name = NULL; GPR_ASSERT( grpc_stream_compression_algorithm_name(algorithm_to_disable, &algo_name)); - char *expected_details = NULL; + char* expected_details = NULL; gpr_asprintf(&expected_details, "Stream compression algorithm '%s' is disabled.", algo_name); /* and we expect a specific reason for it */ @@ -269,7 +269,7 @@ static void request_for_disabled_algorithm( } static void request_with_payload_template( - grpc_end2end_test_config config, const char *test_name, + grpc_end2end_test_config config, const char* test_name, uint32_t client_send_flags_bitmask, grpc_stream_compression_algorithm default_client_channel_compression_algorithm, @@ -277,32 +277,32 @@ static void request_with_payload_template( default_server_channel_compression_algorithm, grpc_stream_compression_algorithm expected_client_compression_algorithm, grpc_stream_compression_algorithm expected_server_compression_algorithm, - grpc_metadata *client_init_metadata, bool set_server_level, + grpc_metadata* client_init_metadata, bool set_server_level, grpc_stream_compression_level server_compression_level, bool send_message_before_initial_metadata, bool set_default_server_message_compression_algorithm, grpc_compression_algorithm default_server_message_compression_algorithm) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice; - grpc_byte_buffer *request_payload = NULL; - grpc_channel_args *client_args; - grpc_channel_args *server_args; + grpc_byte_buffer* request_payload = NULL; + grpc_channel_args* client_args; + grpc_channel_args* server_args; grpc_end2end_test_fixture f; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload; - grpc_byte_buffer *response_payload_recv; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload; + grpc_byte_buffer* response_payload_recv; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - cq_verifier *cqv; + cq_verifier* cqv; char request_str[1024]; char response_str[1024]; diff --git a/test/core/end2end/tests/stream_compression_payload.c b/test/core/end2end/tests/stream_compression_payload.cc index e47d2aa93c..038f0be738 100644 --- a/test/core/end2end/tests/stream_compression_payload.c +++ b/test/core/end2end/tests/stream_compression_payload.cc @@ -23,7 +23,6 @@ #include <grpc/byte_buffer.h> #include <grpc/compression.h> -#include <grpc/compression.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/time.h> @@ -32,12 +31,12 @@ #include "src/core/lib/surface/call.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -54,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -72,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -93,9 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) { static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; - char *output; + char* output; const size_t output_size = 1024 * 1024; - output = (char *)gpr_malloc(output_size); + output = (char*)gpr_malloc(output_size); for (i = 0; i < output_size - 1; ++i) { output[i] = chars[rand() % (int)(sizeof(chars) - 1)]; } @@ -113,20 +112,20 @@ static void request_response_with_payload(grpc_end2end_test_config config, grpc_slice request_payload_slice = generate_random_slice(); grpc_slice response_payload_slice = generate_random_slice(); - grpc_call *c; - grpc_call *s; - grpc_byte_buffer *request_payload = + grpc_call* c; + grpc_call* s; + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; @@ -265,10 +264,10 @@ static void request_response_with_payload(grpc_end2end_test_config config, payload and status. */ static void test_invoke_request_response_with_payload( grpc_end2end_test_config config) { - grpc_channel_args *client_args = + grpc_channel_args* client_args = grpc_channel_args_set_stream_compression_algorithm( NULL, GRPC_STREAM_COMPRESS_GZIP); - grpc_channel_args *server_args = + grpc_channel_args* server_args = grpc_channel_args_set_stream_compression_algorithm( NULL, GRPC_STREAM_COMPRESS_GZIP); grpc_end2end_test_fixture f = diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.c b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc index 4c1a34cc64..a5321bfc61 100644 --- a/test/core/end2end/tests/stream_compression_ping_pong_streaming.c +++ b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc @@ -31,12 +31,12 @@ #include "src/core/lib/surface/call.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -53,14 +53,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -71,13 +71,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -90,19 +90,19 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client pings and server pongs. Repeat messages rounds before finishing. */ static void test_pingpong_streaming(grpc_end2end_test_config config, int messages) { - grpc_channel_args *client_args = + grpc_channel_args* client_args = grpc_channel_args_set_stream_compression_algorithm( NULL, GRPC_STREAM_COMPRESS_GZIP); - grpc_channel_args *server_args = + grpc_channel_args* server_args = grpc_channel_args_set_stream_compression_algorithm( NULL, GRPC_STREAM_COMPRESS_GZIP); grpc_end2end_test_fixture f = begin_test(config, "test_pingpong_streaming", client_args, server_args); - grpc_call *c; - grpc_call *s; - cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_call* c; + grpc_call* s; + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; @@ -111,10 +111,10 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_call_error error; grpc_slice details; int was_cancelled = 2; - grpc_byte_buffer *request_payload; - grpc_byte_buffer *request_payload_recv; - grpc_byte_buffer *response_payload; - grpc_byte_buffer *response_payload_recv; + grpc_byte_buffer* request_payload; + grpc_byte_buffer* request_payload_recv; + grpc_byte_buffer* response_payload; + grpc_byte_buffer* response_payload_recv; int i; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.cc index 8891b8674c..f87fd2c4c3 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.cc @@ -31,12 +31,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args, + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args, bool request_status_early) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s/request_status_early=%s", test_name, @@ -55,14 +55,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -73,13 +73,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -91,24 +91,24 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request with payload, server reads then returns status. */ static void test(grpc_end2end_test_config config, bool request_status_early) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice response_payload1_slice = grpc_slice_from_copied_string("hello"); - grpc_byte_buffer *response_payload1 = + grpc_byte_buffer* response_payload1 = grpc_raw_byte_buffer_create(&response_payload1_slice, 1); grpc_slice response_payload2_slice = grpc_slice_from_copied_string("world"); - grpc_byte_buffer *response_payload2 = + 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", NULL, NULL, request_status_early); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *response_payload1_recv = NULL; - grpc_byte_buffer *response_payload2_recv = NULL; + grpc_byte_buffer* response_payload1_recv = NULL; + grpc_byte_buffer* response_payload2_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.cc index 7aa78a04b8..0da02a56db 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -87,15 +87,15 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Request/response with metadata and payload.*/ static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); grpc_slice response_payload_slice = grpc_slice_from_copied_string("hello you"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - grpc_byte_buffer *response_payload = + grpc_byte_buffer* response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1); grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"), grpc_slice_from_static_string("val1"), @@ -123,14 +123,14 @@ static void test_request_response_with_metadata_and_payload( {{NULL, NULL, NULL, NULL}}}}; grpc_end2end_test_fixture f = begin_test( config, "test_request_response_with_metadata_and_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload_recv = NULL; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload_recv = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/workaround_cronet_compression.c b/test/core/end2end/tests/workaround_cronet_compression.cc index 44e8e04643..8f8ca16a9e 100644 --- a/test/core/end2end/tests/workaround_cronet_compression.c +++ b/test/core/end2end/tests/workaround_cronet_compression.cc @@ -36,12 +36,12 @@ #include "src/core/lib/transport/static_metadata.h" #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -58,14 +58,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -76,13 +76,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -93,36 +93,36 @@ static void end_test(grpc_end2end_test_fixture *f) { } static void request_with_payload_template( - grpc_end2end_test_config config, const char *test_name, + grpc_end2end_test_config config, const char* test_name, uint32_t client_send_flags_bitmask, grpc_compression_algorithm default_client_channel_compression_algorithm, grpc_compression_algorithm default_server_channel_compression_algorithm, grpc_compression_algorithm expected_algorithm_from_client, grpc_compression_algorithm expected_algorithm_from_server, - grpc_metadata *client_init_metadata, bool set_server_level, + grpc_metadata* client_init_metadata, bool set_server_level, grpc_compression_level server_compression_level, - char *user_agent_override) { - grpc_call *c; - grpc_call *s; + char* user_agent_override) { + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice; - grpc_byte_buffer *request_payload; - grpc_channel_args *client_args; - grpc_channel_args *server_args; + grpc_byte_buffer* request_payload; + grpc_channel_args* client_args; + grpc_channel_args* server_args; grpc_end2end_test_fixture f; grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv = NULL; - grpc_byte_buffer *response_payload; - grpc_byte_buffer *response_payload_recv; + grpc_byte_buffer* request_payload_recv = NULL; + grpc_byte_buffer* response_payload; + grpc_byte_buffer* response_payload_recv; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; grpc_slice details; int was_cancelled = 2; - cq_verifier *cqv; + cq_verifier* cqv; char request_str[1024]; char response_str[1024]; @@ -143,9 +143,9 @@ static void request_with_payload_template( if (user_agent_override) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_args *client_args_old = client_args; + grpc_channel_args* client_args_old = client_args; grpc_arg arg; - arg.key = GRPC_ARG_PRIMARY_USER_AGENT_STRING; + arg.key = const_cast<char*>(GRPC_ARG_PRIMARY_USER_AGENT_STRING); arg.type = GRPC_ARG_STRING; arg.value.string = user_agent_override; client_args = grpc_channel_args_copy_and_add(client_args_old, &arg, 1); @@ -360,17 +360,20 @@ static void request_with_payload_template( } typedef struct workaround_cronet_compression_config { - char *user_agent_override; + char* user_agent_override; grpc_compression_algorithm expected_algorithm_from_server; } workaround_cronet_compression_config; static workaround_cronet_compression_config workaround_configs[] = { {NULL, GRPC_COMPRESS_GZIP}, - {"grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; cronet_http; gentle)", + {const_cast<char*>( + "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; cronet_http; gentle)"), GRPC_COMPRESS_NONE}, - {"grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; chttp2; gentle)", + {const_cast<char*>( + "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; chttp2; gentle)"), GRPC_COMPRESS_GZIP}, - {"grpc-objc/1.4.0 grpc-c/3.0.0-dev (ios; cronet_http; gentle)", + {const_cast<char*>( + "grpc-objc/1.4.0 grpc-c/3.0.0-dev (ios; cronet_http; gentle)"), GRPC_COMPRESS_GZIP}}; static const size_t workaround_configs_num = sizeof(workaround_configs) / sizeof(*workaround_configs); diff --git a/test/core/end2end/tests/write_buffering.c b/test/core/end2end/tests/write_buffering.cc index d7d1e5fa3d..5e92e598b3 100644 --- a/test/core/end2end/tests/write_buffering.c +++ b/test/core/end2end/tests/write_buffering.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,25 +86,25 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request with payload, server reads then returns status. */ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice1 = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload1 = + grpc_byte_buffer* request_payload1 = grpc_raw_byte_buffer_create(&request_payload_slice1, 1); grpc_slice request_payload_slice2 = grpc_slice_from_copied_string("abc123"); - grpc_byte_buffer *request_payload2 = + grpc_byte_buffer* request_payload2 = grpc_raw_byte_buffer_create(&request_payload_slice2, 1); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv1 = NULL; - grpc_byte_buffer *request_payload_recv2 = NULL; + grpc_byte_buffer* request_payload_recv1 = NULL; + grpc_byte_buffer* request_payload_recv2 = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; diff --git a/test/core/end2end/tests/write_buffering_at_end.c b/test/core/end2end/tests/write_buffering_at_end.cc index 6113843390..01dacdfd12 100644 --- a/test/core/end2end/tests/write_buffering_at_end.c +++ b/test/core/end2end/tests/write_buffering_at_end.cc @@ -28,12 +28,12 @@ #include <grpc/support/useful.h> #include "test/core/end2end/cq_verifier.h" -static void *tag(intptr_t t) { return (void *)t; } +static void* tag(intptr_t t) { return (void*)t; } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, - const char *test_name, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { + const char* test_name, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name); f = config.create_fixture(client_args, server_args); @@ -50,14 +50,14 @@ static gpr_timespec five_seconds_from_now(void) { return n_seconds_from_now(5); } -static void drain_cq(grpc_completion_queue *cq) { +static void drain_cq(grpc_completion_queue* cq) { grpc_event ev; do { ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } -static void shutdown_server(grpc_end2end_test_fixture *f) { +static void shutdown_server(grpc_end2end_test_fixture* f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), @@ -68,13 +68,13 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { f->server = NULL; } -static void shutdown_client(grpc_end2end_test_fixture *f) { +static void shutdown_client(grpc_end2end_test_fixture* f) { if (!f->client) return; grpc_channel_destroy(f->client); f->client = NULL; } -static void end_test(grpc_end2end_test_fixture *f) { +static void end_test(grpc_end2end_test_fixture* f) { shutdown_server(f); shutdown_client(f); @@ -86,22 +86,22 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client sends a request with payload, server reads then returns status. */ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { - grpc_call *c; - grpc_call *s; + grpc_call* c; + grpc_call* s; grpc_slice request_payload_slice = grpc_slice_from_copied_string("hello world"); - grpc_byte_buffer *request_payload = + grpc_byte_buffer* request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL); - cq_verifier *cqv = cq_verifier_create(f.cq); + cq_verifier* cqv = cq_verifier_create(f.cq); grpc_op ops[6]; - grpc_op *op; + grpc_op* op; grpc_metadata_array initial_metadata_recv; grpc_metadata_array trailing_metadata_recv; grpc_metadata_array request_metadata_recv; - grpc_byte_buffer *request_payload_recv1 = NULL; - grpc_byte_buffer *request_payload_recv2 = NULL; + grpc_byte_buffer* request_payload_recv1 = NULL; + grpc_byte_buffer* request_payload_recv2 = NULL; grpc_call_details call_details; grpc_status_code status; grpc_call_error error; |