diff options
Diffstat (limited to 'test/core/end2end/fixtures')
-rw-r--r-- | test/core/end2end/fixtures/h2_census.cc (renamed from test/core/end2end/fixtures/h2_census.c) | 14 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_compress.cc (renamed from test/core/end2end/fixtures/h2_compress.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_fakesec.cc (renamed from test/core/end2end/fixtures/h2_fakesec.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_fd.cc (renamed from test/core/end2end/fixtures/h2_fd.c) | 7 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full+pipe.cc (renamed from test/core/end2end/fixtures/h2_full+pipe.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full+trace.cc (renamed from test/core/end2end/fixtures/h2_full+trace.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full+workarounds.cc (renamed from test/core/end2end/fixtures/h2_full+workarounds.c) | 14 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full.cc (renamed from test/core/end2end/fixtures/h2_full.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_http_proxy.cc (renamed from test/core/end2end/fixtures/h2_http_proxy.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_load_reporting.cc (renamed from test/core/end2end/fixtures/h2_load_reporting.c) | 13 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_oauth2.cc (renamed from test/core/end2end/fixtures/h2_oauth2.c) | 22 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_proxy.cc (renamed from test/core/end2end/fixtures/h2_proxy.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair+trace.cc (renamed from test/core/end2end/fixtures/h2_sockpair+trace.c) | 13 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair.cc (renamed from test/core/end2end/fixtures/h2_sockpair.c) | 13 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair_1byte.cc (renamed from test/core/end2end/fixtures/h2_sockpair_1byte.c) | 34 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl.cc (renamed from test/core/end2end/fixtures/h2_ssl.c) | 19 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl_proxy.cc (renamed from test/core/end2end/fixtures/h2_ssl_proxy.c) | 26 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_uds.cc (renamed from test/core/end2end/fixtures/h2_uds.c) | 12 | ||||
-rw-r--r-- | test/core/end2end/fixtures/http_proxy_fixture.cc (renamed from test/core/end2end/fixtures/http_proxy_fixture.c) | 0 | ||||
-rw-r--r-- | test/core/end2end/fixtures/inproc.cc (renamed from test/core/end2end/fixtures/inproc.c) | 5 | ||||
-rw-r--r-- | test/core/end2end/fixtures/proxy.cc (renamed from test/core/end2end/fixtures/proxy.c) | 0 |
21 files changed, 171 insertions, 105 deletions
diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.cc index 29e55ef4fd..4213140f4a 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.cc @@ -44,7 +44,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -59,14 +60,15 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( static grpc_arg make_census_enable_arg(void) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; - arg.key = GRPC_ARG_ENABLE_CENSUS; + arg.key = const_cast<char*>(GRPC_ARG_ENABLE_CENSUS); arg.value.integer = 1; return arg; } void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); grpc_arg arg = make_census_enable_arg(); client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); @@ -80,7 +82,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); grpc_arg arg = make_census_enable_arg(); if (f->server) { grpc_server_destroy(f->server); @@ -98,7 +101,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.cc index a2f9a2277c..64e028b950 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -47,7 +47,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_compression_fixture_data* ffd = - gpr_malloc(sizeof(fullstack_compression_fixture_data)); + static_cast<fullstack_compression_fixture_data*>( + gpr_malloc(sizeof(fullstack_compression_fixture_data))); memset(ffd, 0, sizeof(fullstack_compression_fixture_data)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -62,7 +63,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_compression_fixture_data* ffd = f->fixture_data; + fullstack_compression_fixture_data* ffd = + static_cast<fullstack_compression_fixture_data*>(f->fixture_data); if (ffd->client_args_compression != NULL) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression); @@ -76,7 +78,8 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f, void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_compression_fixture_data* ffd = f->fixture_data; + fullstack_compression_fixture_data* ffd = + static_cast<fullstack_compression_fixture_data*>(f->fixture_data); if (ffd->server_args_compression != NULL) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression); @@ -95,7 +98,8 @@ void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f, void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture* f) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - fullstack_compression_fixture_data* ffd = f->fixture_data; + fullstack_compression_fixture_data* ffd = + static_cast<fullstack_compression_fixture_data*>(f->fixture_data); grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression); grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression); gpr_free(ffd->localaddr); diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.cc index 74fec936e8..fbf2f49729 100644 --- a/test/core/end2end/fixtures/h2_fakesec.c +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -39,7 +39,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data* ffd = - gpr_malloc(sizeof(fullstack_secure_fixture_data)); + static_cast<fullstack_secure_fixture_data*>( + gpr_malloc(sizeof(fullstack_secure_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -62,7 +63,8 @@ static void process_auth_failure(void* state, grpc_auth_context* ctx, static void chttp2_init_client_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args, grpc_channel_credentials* creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -72,7 +74,8 @@ static void chttp2_init_client_secure_fullstack( static void chttp2_init_server_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args, grpc_server_credentials* server_creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -85,7 +88,8 @@ static void chttp2_init_server_secure_fullstack( } void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.cc index 337ae8945a..7005b969a0 100644 --- a/test/core/end2end/fixtures/h2_fd.c +++ b/test/core/end2end/fixtures/h2_fd.cc @@ -52,7 +52,8 @@ static void create_sockets(int sv[2]) { static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_channel_args* client_args, grpc_channel_args* server_args) { - sp_fixture_data* fixture_data = gpr_malloc(sizeof(*fixture_data)); + sp_fixture_data* fixture_data = + static_cast<sp_fixture_data*>(gpr_malloc(sizeof(*fixture_data))); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -68,7 +69,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - sp_fixture_data* sfd = f->fixture_data; + sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data); GPR_ASSERT(!f->client); f->client = grpc_insecure_channel_create_from_fd( @@ -81,7 +82,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - sp_fixture_data* sfd = f->fixture_data; + sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data); GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); GPR_ASSERT(f->server); diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.cc index d36ba361b6..0dd650b8e0 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.cc @@ -49,7 +49,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -63,14 +64,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -81,7 +84,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.cc index 62195f30d1..21372c6dee 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.cc @@ -49,7 +49,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -63,14 +64,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -81,7 +84,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_full+workarounds.c b/test/core/end2end/fixtures/h2_full+workarounds.cc index 0a331b0fc0..ebffe2125c 100644 --- a/test/core/end2end/fixtures/h2_full+workarounds.c +++ b/test/core/end2end/fixtures/h2_full+workarounds.cc @@ -37,7 +37,7 @@ #include "test/core/util/test_config.h" static char* workarounds_arg[GRPC_MAX_WORKAROUND_ID] = { - GRPC_ARG_WORKAROUND_CRONET_COMPRESSION}; + const_cast<char*>(GRPC_ARG_WORKAROUND_CRONET_COMPRESSION)}; typedef struct fullstack_fixture_data { char* localaddr; @@ -47,7 +47,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -61,7 +62,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } @@ -70,7 +72,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { int i; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); grpc_arg args[GRPC_MAX_WORKAROUND_ID]; for (i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) { args[i].key = workarounds_arg[i]; @@ -91,7 +94,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.cc index 496ca6304e..895af67930 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.cc @@ -43,7 +43,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -57,14 +58,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -75,7 +78,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.cc index dd3ccf3575..a67ce82064 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.cc @@ -47,7 +47,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); const int server_port = grpc_pick_unused_port_or_die(); gpr_join_host_port(&ffd->server_addr, "localhost", server_port); @@ -64,7 +65,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); char* proxy_uri; /* If testing for proxy auth, add credentials to proxy uri */ @@ -85,7 +87,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -96,7 +99,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->server_addr); grpc_end2end_http_proxy_destroy(ffd->proxy); gpr_free(ffd); diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.cc index 23323962dd..b402fc5620 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.c +++ b/test/core/end2end/fixtures/h2_load_reporting.cc @@ -45,8 +45,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); - load_reporting_fixture_data* ffd = - gpr_malloc(sizeof(load_reporting_fixture_data)); + load_reporting_fixture_data* ffd = static_cast<load_reporting_fixture_data*>( + gpr_malloc(sizeof(load_reporting_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -60,14 +60,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - load_reporting_fixture_data* ffd = f->fixture_data; + load_reporting_fixture_data* ffd = + static_cast<load_reporting_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client); } void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - load_reporting_fixture_data* ffd = f->fixture_data; + load_reporting_fixture_data* ffd = + static_cast<load_reporting_fixture_data*>(f->fixture_data); grpc_arg arg = grpc_load_reporting_enable_arg(); if (f->server) { grpc_server_destroy(f->server); @@ -85,7 +87,8 @@ void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f, } void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture* f) { - load_reporting_fixture_data* ffd = f->fixture_data; + load_reporting_fixture_data* ffd = + static_cast<load_reporting_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.cc index 6a4173bfb7..88e590a15f 100644 --- a/test/core/end2end/fixtures/h2_oauth2.c +++ b/test/core/end2end/fixtures/h2_oauth2.cc @@ -94,7 +94,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data* ffd = - gpr_malloc(sizeof(fullstack_secure_fixture_data)); + static_cast<fullstack_secure_fixture_data*>( + gpr_malloc(sizeof(fullstack_secure_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -109,7 +110,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( static void chttp2_init_client_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args, grpc_channel_credentials* creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -119,7 +121,8 @@ static void chttp2_init_client_secure_fullstack( static void chttp2_init_server_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args, grpc_server_credentials* server_creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -132,7 +135,8 @@ static void chttp2_init_server_secure_fullstack( } void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } @@ -146,9 +150,10 @@ static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack( &exec_ctx, "authorization", oauth2_md, true /* is_async */); grpc_channel_credentials* ssl_oauth2_creds = grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, NULL); - grpc_arg ssl_name_override = {GRPC_ARG_STRING, - GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - {"foo.test.google.fr"}}; + grpc_arg ssl_name_override = { + GRPC_ARG_STRING, + const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), + {const_cast<char*>("foo.test.google.fr")}}; grpc_channel_args* new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_oauth2_creds); @@ -177,7 +182,8 @@ static void processor_destroy(void* state) { } static grpc_auth_metadata_processor test_processor_create(int failing) { - test_processor_state* s = gpr_malloc(sizeof(*s)); + test_processor_state* s = + static_cast<test_processor_state*>(gpr_malloc(sizeof(*s))); grpc_auth_metadata_processor result; s->pseudo_refcount = 1; result.state = s; diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.cc index 96c9b6e96c..03ffa02e17 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.cc @@ -58,7 +58,8 @@ static const grpc_end2end_proxy_def proxy_def = {create_proxy_server, static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); @@ -72,7 +73,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create( grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, NULL); GPR_ASSERT(f->client); @@ -80,7 +82,8 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -92,7 +95,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); grpc_end2end_proxy_destroy(ffd->proxy); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.cc index fa2e6c6b11..c5dfe40391 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.cc @@ -49,9 +49,9 @@ connected_channel without a client_channel */ static void server_setup_transport(void* ts, grpc_transport* transport) { - grpc_end2end_test_fixture* f = ts; + grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); @@ -65,7 +65,7 @@ typedef struct { static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, grpc_transport* transport) { - sp_client_setup* cs = ts; + sp_client_setup* cs = static_cast<sp_client_setup*>(ts); cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -74,7 +74,8 @@ static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_channel_args* client_args, grpc_channel_args* server_args) { - grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); + grpc_endpoint_pair* sfd = + static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair))); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -90,7 +91,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; @@ -106,7 +107,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.cc index 024b45767b..f07722e52d 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.cc @@ -43,9 +43,9 @@ connected_channel without a client_channel */ static void server_setup_transport(void* ts, grpc_transport* transport) { - grpc_end2end_test_fixture* f = ts; + grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); @@ -59,7 +59,7 @@ typedef struct { static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, grpc_transport* transport) { - sp_client_setup* cs = ts; + sp_client_setup* cs = static_cast<sp_client_setup*>(ts); cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -68,7 +68,8 @@ static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_channel_args* client_args, grpc_channel_args* server_args) { - grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); + grpc_endpoint_pair* sfd = + static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair))); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -84,7 +85,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; @@ -100,7 +101,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.cc index f8ab7e7f9d..7d00c69a18 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc @@ -43,9 +43,9 @@ connected_channel without a client_channel */ static void server_setup_transport(void* ts, grpc_transport* transport) { - grpc_end2end_test_fixture* f = ts; + grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); @@ -59,7 +59,7 @@ typedef struct { static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, grpc_transport* transport) { - sp_client_setup* cs = ts; + sp_client_setup* cs = static_cast<sp_client_setup*>(ts); cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -68,7 +68,8 @@ static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_channel_args* client_args, grpc_channel_args* server_args) { - grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); + grpc_endpoint_pair* sfd = + static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair))); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -76,16 +77,17 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( f.cq = grpc_completion_queue_create_for_next(NULL); f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE, - .type = GRPC_ARG_INTEGER, - .value.integer = 1}, - {.key = GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE, - .type = GRPC_ARG_INTEGER, - .value.integer = 1}, - {.key = GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE, - .type = GRPC_ARG_INTEGER, - .value.integer = 1}}; - grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a}; + grpc_arg a[3]; + a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE); + a[0].type = GRPC_ARG_INTEGER; + a[0].value.integer = 1; + a[1].key = const_cast<char*>(GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE); + a[1].type = GRPC_ARG_INTEGER; + a[1].value.integer = 1; + a[2].key = const_cast<char*>(GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE); + a[2].type = GRPC_ARG_INTEGER; + a[2].value.integer = 1; + grpc_channel_args args = {GPR_ARRAY_SIZE(a), a}; *sfd = grpc_iomgr_create_endpoint_pair("fixture", &args); return f; @@ -94,7 +96,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; @@ -110,7 +112,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f, static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair* sfd = f->fixture_data; + grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.cc index 10e2ce04f5..70daefd333 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.cc @@ -43,7 +43,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( grpc_end2end_test_fixture f; int port = grpc_pick_unused_port_or_die(); fullstack_secure_fixture_data* ffd = - gpr_malloc(sizeof(fullstack_secure_fixture_data)); + static_cast<fullstack_secure_fixture_data*>( + gpr_malloc(sizeof(fullstack_secure_fixture_data))); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -66,7 +67,8 @@ static void process_auth_failure(void* state, grpc_auth_context* ctx, static void chttp2_init_client_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args, grpc_channel_credentials* creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -76,7 +78,8 @@ static void chttp2_init_client_secure_fullstack( static void chttp2_init_server_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args, grpc_server_credentials* server_creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -89,7 +92,8 @@ static void chttp2_init_server_secure_fullstack( } void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } @@ -98,9 +102,10 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(NULL, NULL, NULL); - grpc_arg ssl_name_override = {GRPC_ARG_STRING, - GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - {"foo.test.google.fr"}}; + grpc_arg ssl_name_override = { + GRPC_ARG_STRING, + const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), + {const_cast<char*>("foo.test.google.fr")}}; grpc_channel_args* new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds); diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.cc index 1530707f56..b3488a29e5 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc @@ -56,9 +56,10 @@ static grpc_channel* create_proxy_client(const char* target, grpc_channel* channel; grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(NULL, NULL, NULL); - grpc_arg ssl_name_override = {GRPC_ARG_STRING, - GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - {"foo.test.google.fr"}}; + grpc_arg ssl_name_override = { + GRPC_ARG_STRING, + const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), + {const_cast<char*>("foo.test.google.fr")}}; grpc_channel_args* new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); channel = @@ -79,7 +80,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; fullstack_secure_fixture_data* ffd = - gpr_malloc(sizeof(fullstack_secure_fixture_data)); + static_cast<fullstack_secure_fixture_data*>( + gpr_malloc(sizeof(fullstack_secure_fixture_data))); memset(&f, 0, sizeof(f)); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); @@ -102,7 +104,8 @@ static void process_auth_failure(void* state, grpc_auth_context* ctx, static void chttp2_init_client_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args, grpc_channel_credentials* creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); f->client = grpc_secure_channel_create( creds, grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, NULL); @@ -113,7 +116,8 @@ static void chttp2_init_client_secure_fullstack( static void chttp2_init_server_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* server_args, grpc_server_credentials* server_creds) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -126,7 +130,8 @@ static void chttp2_init_server_secure_fullstack( } void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { - fullstack_secure_fixture_data* ffd = f->fixture_data; + fullstack_secure_fixture_data* ffd = + static_cast<fullstack_secure_fixture_data*>(f->fixture_data); grpc_end2end_proxy_destroy(ffd->proxy); gpr_free(ffd); } @@ -135,9 +140,10 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(NULL, NULL, NULL); - grpc_arg ssl_name_override = {GRPC_ARG_STRING, - GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, - {"foo.test.google.fr"}}; + grpc_arg ssl_name_override = { + GRPC_ARG_STRING, + const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG), + {const_cast<char*>("foo.test.google.fr")}}; grpc_channel_args* new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds); diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.cc index b090f5d590..ba433df57b 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.cc @@ -48,7 +48,8 @@ static int unique = 1; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; - fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>( + gpr_malloc(sizeof(fullstack_fixture_data))); memset(&f, 0, sizeof(f)); gpr_asprintf(&ffd->localaddr, "unix:/tmp/grpc_fullstack_test.%d.%d", getpid(), @@ -63,13 +64,15 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); } void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); if (f->server) { grpc_server_destroy(f->server); } @@ -80,7 +83,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, } void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { - fullstack_fixture_data* ffd = f->fixture_data; + fullstack_fixture_data* ffd = + static_cast<fullstack_fixture_data*>(f->fixture_data); gpr_free(ffd->localaddr); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.cc index d29401fdc3..d29401fdc3 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.c +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc diff --git a/test/core/end2end/fixtures/inproc.c b/test/core/end2end/fixtures/inproc.cc index 02e8030dd0..5107ed2018 100644 --- a/test/core/end2end/fixtures/inproc.c +++ b/test/core/end2end/fixtures/inproc.cc @@ -42,7 +42,8 @@ typedef struct inproc_fixture_data { static grpc_end2end_test_fixture inproc_create_fixture( grpc_channel_args* client_args, grpc_channel_args* server_args) { grpc_end2end_test_fixture f; - inproc_fixture_data* ffd = gpr_malloc(sizeof(inproc_fixture_data)); + inproc_fixture_data* ffd = static_cast<inproc_fixture_data*>( + gpr_malloc(sizeof(inproc_fixture_data))); memset(&f, 0, sizeof(f)); f.fixture_data = ffd; @@ -69,7 +70,7 @@ void inproc_init_server(grpc_end2end_test_fixture* f, } void inproc_tear_down(grpc_end2end_test_fixture* f) { - inproc_fixture_data* ffd = f->fixture_data; + inproc_fixture_data* ffd = static_cast<inproc_fixture_data*>(f->fixture_data); gpr_free(ffd); } diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.cc index 01c9e13538..01c9e13538 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.cc |