diff options
author | Muxi Yan <mxyan@google.com> | 2017-12-06 18:52:18 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-12-06 18:55:05 -0800 |
commit | 38fcd0c6c3e70e516d1e4dcbfd9cdfe9654f4b0f (patch) | |
tree | 531100570cfbe084b31e65facc1c49dae5434f52 /test/core/end2end/fixtures | |
parent | f5eb1cf9f0e832a2a6d301cc7adeec22e79ef903 (diff) |
clang-format
Diffstat (limited to 'test/core/end2end/fixtures')
21 files changed, 442 insertions, 429 deletions
diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index 9870ccb34a..29e55ef4fd 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -37,14 +37,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -64,9 +64,9 @@ static grpc_arg make_census_enable_arg(void) { return arg; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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); @@ -78,9 +78,9 @@ 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; grpc_arg arg = make_census_enable_arg(); if (f->server) { grpc_server_destroy(f->server); @@ -97,22 +97,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+census", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index 0f4621ae34..e3d64d0c70 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -37,16 +37,16 @@ #include "test/core/util/test_config.h" typedef struct fullstack_compression_fixture_data { - char *localaddr; - grpc_channel_args *client_args_compression; - grpc_channel_args *server_args_compression; + char* localaddr; + grpc_channel_args* client_args_compression; + grpc_channel_args* server_args_compression; } fullstack_compression_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_compression_fixture_data *ffd = + fullstack_compression_fixture_data* ffd = gpr_malloc(sizeof(fullstack_compression_fixture_data)); memset(ffd, 0, sizeof(fullstack_compression_fixture_data)); @@ -60,9 +60,9 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( return f; } -void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_compression_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_compression_fixture_data* ffd = 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); @@ -74,9 +74,9 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f, ffd->client_args_compression, NULL); } -void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { - fullstack_compression_fixture_data *ffd = f->fixture_data; +void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_compression_fixture_data* ffd = 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); @@ -93,9 +93,9 @@ void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_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 = 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); @@ -105,16 +105,17 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_compression", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack_compression, chttp2_init_client_fullstack_compression, chttp2_init_server_fullstack_compression, chttp2_tear_down_fullstack_compression}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.c index e622d952be..74fec936e8 100644 --- a/test/core/end2end/fixtures/h2_fakesec.c +++ b/test/core/end2end/fixtures/h2_fakesec.c @@ -31,14 +31,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { - char *localaddr; + char* localaddr; } fullstack_secure_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_secure_fixture_data *ffd = + fullstack_secure_fixture_data* ffd = gpr_malloc(sizeof(fullstack_secure_fixture_data)); memset(&f, 0, sizeof(f)); @@ -51,18 +51,18 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( return f; } -static void process_auth_failure(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, +static void process_auth_failure(void* state, grpc_auth_context* ctx, + const grpc_metadata* md, size_t md_count, grpc_process_auth_metadata_done_cb cb, - void *user_data) { + void* user_data) { GPR_ASSERT(state == NULL); cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); } 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; + grpc_end2end_test_fixture* f, grpc_channel_args* client_args, + grpc_channel_credentials* creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -70,9 +70,9 @@ 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; + grpc_end2end_test_fixture* f, grpc_channel_args* server_args, + grpc_server_credentials* server_creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -84,20 +84,20 @@ static void chttp2_init_server_secure_fullstack( grpc_server_start(f->server); } -void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { - fullstack_secure_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { + fullstack_secure_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } static void chttp2_init_client_fake_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { - grpc_channel_credentials *fake_ts_creds = + grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { + grpc_channel_credentials* fake_ts_creds = grpc_fake_transport_security_credentials_create(); chttp2_init_client_secure_fullstack(f, client_args, fake_ts_creds); } -static int fail_server_auth_check(grpc_channel_args *server_args) { +static int fail_server_auth_check(grpc_channel_args* server_args) { size_t i; if (server_args == NULL) return 0; for (i = 0; i < server_args->num_args; i++) { @@ -110,8 +110,8 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { } static void chttp2_init_server_fake_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { - grpc_server_credentials *fake_ts_creds = + grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { + grpc_server_credentials* fake_ts_creds = grpc_fake_transport_security_server_credentials_create(); if (fail_server_auth_check(server_args)) { grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; @@ -135,7 +135,7 @@ static grpc_end2end_test_config configs[] = { chttp2_tear_down_secure_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); grpc_end2end_tests_pre_init(); diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c index e82c120221..337ae8945a 100644 --- a/test/core/end2end/fixtures/h2_fd.c +++ b/test/core/end2end/fixtures/h2_fd.c @@ -35,7 +35,9 @@ #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "test/core/util/test_config.h" -typedef struct { int fd_pair[2]; } sp_fixture_data; +typedef struct { + int fd_pair[2]; +} sp_fixture_data; static void create_sockets(int sv[2]) { int flags; @@ -49,8 +51,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)); + grpc_channel_args* client_args, grpc_channel_args* server_args) { + sp_fixture_data* fixture_data = gpr_malloc(sizeof(*fixture_data)); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -63,10 +65,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( return f; } -static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { +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 = f->fixture_data; GPR_ASSERT(!f->client); f->client = grpc_insecure_channel_create_from_fd( @@ -76,10 +78,10 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { +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 = f->fixture_data; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); GPR_ASSERT(f->server); @@ -91,7 +93,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { +static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } @@ -102,7 +104,7 @@ static grpc_end2end_test_config configs[] = { chttp2_init_server_socketpair, chttp2_tear_down_socketpair}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); @@ -120,6 +122,6 @@ int main(int argc, char **argv) { #else /* GRPC_POSIX_SOCKET */ -int main(int argc, char **argv) { return 1; } +int main(int argc, char** argv) { return 1; } #endif /* GRPC_POSIX_SOCKET */ diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c index c764bd704a..d36ba361b6 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.c @@ -42,14 +42,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -61,16 +61,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -80,22 +80,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_allow_specialized_wakeup_fd = 0; @@ -115,6 +116,6 @@ int main(int argc, char **argv) { #else /* GRPC_POSIX_WAKEUP_FD */ -int main(int argc, char **argv) { return 1; } +int main(int argc, char** argv) { return 1; } #endif /* GRPC_POSIX_WAKEUP_FD */ diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index 7eb29e0d32..62195f30d1 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -42,14 +42,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -61,16 +61,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -80,22 +80,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; /* force tracing on, with a value to force many diff --git a/test/core/end2end/fixtures/h2_full+workarounds.c b/test/core/end2end/fixtures/h2_full+workarounds.c index a98e5ad57f..0a331b0fc0 100644 --- a/test/core/end2end/fixtures/h2_full+workarounds.c +++ b/test/core/end2end/fixtures/h2_full+workarounds.c @@ -36,18 +36,18 @@ #include "test/core/util/port.h" #include "test/core/util/test_config.h" -static char *workarounds_arg[GRPC_MAX_WORKAROUND_ID] = { +static char* workarounds_arg[GRPC_MAX_WORKAROUND_ID] = { GRPC_ARG_WORKAROUND_CRONET_COMPRESSION}; typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -59,25 +59,25 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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) { +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 = 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]; args[i].type = GRPC_ARG_INTEGER; args[i].value.integer = 1; } - grpc_channel_args *server_args_new = + grpc_channel_args* server_args_new = grpc_channel_args_copy_and_add(server_args, args, GRPC_MAX_WORKAROUND_ID); if (f->server) { grpc_server_destroy(f->server); @@ -90,23 +90,24 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER | - FEATURE_MASK_SUPPORTS_WORKAROUNDS, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER | + FEATURE_MASK_SUPPORTS_WORKAROUNDS, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index ae68bd9698..496ca6304e 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -36,14 +36,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_join_host_port(&ffd->localaddr, "localhost", port); @@ -55,16 +55,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -74,22 +74,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index 6145892365..dd3ccf3575 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -39,15 +39,15 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *server_addr; - grpc_end2end_http_proxy *proxy; + char* server_addr; + grpc_end2end_http_proxy* proxy; } fullstack_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; memset(&f, 0, sizeof(f)); - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = 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); @@ -62,13 +62,13 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; - char *proxy_uri; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = f->fixture_data; + char* proxy_uri; /* If testing for proxy auth, add credentials to proxy uri */ - const grpc_arg *proxy_auth_arg = + const grpc_arg* proxy_auth_arg = grpc_channel_args_find(client_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS); if (proxy_auth_arg == NULL || proxy_auth_arg->type != GRPC_ARG_STRING) { gpr_asprintf(&proxy_uri, "http://%s", @@ -83,9 +83,9 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -95,8 +95,8 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->server_addr); grpc_end2end_http_proxy_destroy(ffd->proxy); gpr_free(ffd); @@ -104,14 +104,15 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c index 8a05bb722a..23323962dd 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.c +++ b/test/core/end2end/fixtures/h2_load_reporting.c @@ -38,14 +38,14 @@ #include "test/core/util/test_config.h" typedef struct load_reporting_fixture_data { - char *localaddr; + char* localaddr; } load_reporting_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( - 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; int port = grpc_pick_unused_port_or_die(); - load_reporting_fixture_data *ffd = + load_reporting_fixture_data* ffd = gpr_malloc(sizeof(load_reporting_fixture_data)); memset(&f, 0, sizeof(f)); @@ -58,16 +58,16 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( return f; } -void chttp2_init_client_load_reporting(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - load_reporting_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + load_reporting_fixture_data* ffd = 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; +void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + load_reporting_fixture_data* ffd = f->fixture_data; grpc_arg arg = grpc_load_reporting_enable_arg(); if (f->server) { grpc_server_destroy(f->server); @@ -84,8 +84,8 @@ void chttp2_init_server_load_reporting(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture *f) { - load_reporting_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture* f) { + load_reporting_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } @@ -100,7 +100,7 @@ static grpc_end2end_test_config configs[] = { chttp2_init_server_load_reporting, chttp2_tear_down_load_reporting}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.c index ee1d0b1416..6a4173bfb7 100644 --- a/test/core/end2end/fixtures/h2_oauth2.c +++ b/test/core/end2end/fixtures/h2_oauth2.c @@ -32,16 +32,16 @@ #include "test/core/util/test_config.h" static const char oauth2_md[] = "Bearer aaslkfjs424535asdf"; -static const char *client_identity_property_name = "smurf_name"; -static const char *client_identity = "Brainy Smurf"; +static const char* client_identity_property_name = "smurf_name"; +static const char* client_identity = "Brainy Smurf"; typedef struct fullstack_secure_fixture_data { - char *localaddr; + char* localaddr; } fullstack_secure_fixture_data; -static const grpc_metadata *find_metadata(const grpc_metadata *md, - size_t md_count, const char *key, - const char *value) { +static const grpc_metadata* find_metadata(const grpc_metadata* md, + size_t md_count, const char* key, + const char* value) { size_t i; for (i = 0; i < md_count; i++) { if (grpc_slice_str_cmp(md[i].key, key) == 0 && @@ -52,18 +52,20 @@ static const grpc_metadata *find_metadata(const grpc_metadata *md, return NULL; } -typedef struct { size_t pseudo_refcount; } test_processor_state; +typedef struct { + size_t pseudo_refcount; +} test_processor_state; -static void process_oauth2_success(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, +static void process_oauth2_success(void* state, grpc_auth_context* ctx, + const grpc_metadata* md, size_t md_count, grpc_process_auth_metadata_done_cb cb, - void *user_data) { - const grpc_metadata *oauth2 = + void* user_data) { + const grpc_metadata* oauth2 = find_metadata(md, md_count, "authorization", oauth2_md); - test_processor_state *s; + test_processor_state* s; GPR_ASSERT(state != NULL); - s = (test_processor_state *)state; + s = (test_processor_state*)state; GPR_ASSERT(s->pseudo_refcount == 1); GPR_ASSERT(oauth2 != NULL); grpc_auth_context_add_cstring_property(ctx, client_identity_property_name, @@ -73,25 +75,25 @@ static void process_oauth2_success(void *state, grpc_auth_context *ctx, cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_OK, NULL); } -static void process_oauth2_failure(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, +static void process_oauth2_failure(void* state, grpc_auth_context* ctx, + const grpc_metadata* md, size_t md_count, grpc_process_auth_metadata_done_cb cb, - void *user_data) { - const grpc_metadata *oauth2 = + void* user_data) { + const grpc_metadata* oauth2 = find_metadata(md, md_count, "authorization", oauth2_md); - test_processor_state *s; + test_processor_state* s; GPR_ASSERT(state != NULL); - s = (test_processor_state *)state; + s = (test_processor_state*)state; GPR_ASSERT(s->pseudo_refcount == 1); GPR_ASSERT(oauth2 != NULL); cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); } static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_secure_fixture_data *ffd = + fullstack_secure_fixture_data* ffd = gpr_malloc(sizeof(fullstack_secure_fixture_data)); memset(&f, 0, sizeof(f)); @@ -105,9 +107,9 @@ 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; + grpc_end2end_test_fixture* f, grpc_channel_args* client_args, + grpc_channel_credentials* creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -115,9 +117,9 @@ 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; + grpc_end2end_test_fixture* f, grpc_channel_args* server_args, + grpc_server_credentials* server_creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -129,25 +131,25 @@ static void chttp2_init_server_secure_fullstack( grpc_server_start(f->server); } -void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { - fullstack_secure_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { + fullstack_secure_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { + grpc_end2end_test_fixture* f, grpc_channel_args* client_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_channel_credentials *ssl_creds = + grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(test_root_cert, NULL, NULL); - grpc_call_credentials *oauth2_creds = grpc_md_only_test_credentials_create( + grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create( &exec_ctx, "authorization", oauth2_md, true /* is_async */); - grpc_channel_credentials *ssl_oauth2_creds = + grpc_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_channel_args *new_client_args = + 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); grpc_channel_args_destroy(&exec_ctx, new_client_args); @@ -156,7 +158,7 @@ static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack( grpc_exec_ctx_finish(&exec_ctx); } -static int fail_server_auth_check(grpc_channel_args *server_args) { +static int fail_server_auth_check(grpc_channel_args* server_args) { size_t i; if (server_args == NULL) return 0; for (i = 0; i < server_args->num_args; i++) { @@ -168,14 +170,14 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { return 0; } -static void processor_destroy(void *state) { - test_processor_state *s = (test_processor_state *)state; +static void processor_destroy(void* state) { + test_processor_state* s = (test_processor_state*)state; GPR_ASSERT((s->pseudo_refcount--) == 1); gpr_free(s); } static grpc_auth_metadata_processor test_processor_create(int failing) { - test_processor_state *s = gpr_malloc(sizeof(*s)); + test_processor_state* s = gpr_malloc(sizeof(*s)); grpc_auth_metadata_processor result; s->pseudo_refcount = 1; result.state = s; @@ -189,10 +191,10 @@ static grpc_auth_metadata_processor test_processor_create(int failing) { } static void chttp2_init_server_simple_ssl_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { + grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials *ssl_creds = + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL); grpc_server_credentials_set_auth_metadata_processor( ssl_creds, test_processor_create(fail_server_auth_check(server_args))); @@ -213,7 +215,7 @@ static grpc_end2end_test_config configs[] = { chttp2_tear_down_secure_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); grpc_end2end_tests_pre_init(); diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 069130baf4..96c9b6e96c 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -37,18 +37,18 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - grpc_end2end_proxy *proxy; + grpc_end2end_proxy* proxy; } fullstack_fixture_data; -static grpc_server *create_proxy_server(const char *port, - grpc_channel_args *server_args) { - grpc_server *s = grpc_server_create(server_args, NULL); +static grpc_server* create_proxy_server(const char* port, + grpc_channel_args* server_args) { + grpc_server* s = grpc_server_create(server_args, NULL); GPR_ASSERT(grpc_server_add_insecure_http2_port(s, port)); return s; } -static grpc_channel *create_proxy_client(const char *target, - grpc_channel_args *client_args) { +static grpc_channel* create_proxy_client(const char* target, + grpc_channel_args* client_args) { return grpc_insecure_channel_create(target, client_args, NULL); } @@ -56,9 +56,9 @@ static const grpc_end2end_proxy_def proxy_def = {create_proxy_server, create_proxy_client}; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); @@ -70,17 +70,17 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = f->fixture_data; f->client = grpc_insecure_channel_create( grpc_end2end_proxy_get_client_target(ffd->proxy), 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -91,23 +91,24 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; grpc_end2end_proxy_destroy(ffd->proxy); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+proxy", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 39ccb84b52..fa2e6c6b11 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -48,10 +48,10 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport) { - grpc_end2end_test_fixture *f = ts; +static void server_setup_transport(void* ts, grpc_transport* transport) { + grpc_end2end_test_fixture* f = ts; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair *sfd = f->fixture_data; + grpc_endpoint_pair* sfd = 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,13 +59,13 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { } typedef struct { - grpc_end2end_test_fixture *f; - grpc_channel_args *client_args; + grpc_end2end_test_fixture* f; + grpc_channel_args* client_args; } sp_client_setup; -static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport) { - sp_client_setup *cs = ts; +static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, + grpc_transport* transport) { + sp_client_setup* cs = ts; cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -73,8 +73,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_channel_args* client_args, grpc_channel_args* server_args) { + grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -87,11 +87,11 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( return f; } -static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; cs.f = f; @@ -103,11 +103,11 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); grpc_server_register_completion_queue(f->server, f->cq, NULL); @@ -119,7 +119,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { +static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } @@ -130,7 +130,7 @@ static grpc_end2end_test_config configs[] = { chttp2_init_server_socketpair, chttp2_tear_down_socketpair}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index 03566ead9b..024b45767b 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -42,10 +42,10 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport) { - grpc_end2end_test_fixture *f = ts; +static void server_setup_transport(void* ts, grpc_transport* transport) { + grpc_end2end_test_fixture* f = ts; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair *sfd = f->fixture_data; + grpc_endpoint_pair* sfd = 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)); @@ -53,13 +53,13 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { } typedef struct { - grpc_end2end_test_fixture *f; - grpc_channel_args *client_args; + grpc_end2end_test_fixture* f; + grpc_channel_args* client_args; } sp_client_setup; -static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport) { - sp_client_setup *cs = ts; +static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, + grpc_transport* transport) { + sp_client_setup* cs = ts; cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -67,8 +67,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_channel_args* client_args, grpc_channel_args* server_args) { + grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -81,11 +81,11 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( return f; } -static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; cs.f = f; @@ -97,11 +97,11 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); grpc_server_register_completion_queue(f->server, f->cq, NULL); @@ -113,7 +113,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { +static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } @@ -124,7 +124,7 @@ static grpc_end2end_test_config configs[] = { chttp2_init_server_socketpair, chttp2_tear_down_socketpair}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index c75a3876d5..f8ab7e7f9d 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -42,10 +42,10 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport) { - grpc_end2end_test_fixture *f = ts; +static void server_setup_transport(void* ts, grpc_transport* transport) { + grpc_end2end_test_fixture* f = ts; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_endpoint_pair *sfd = f->fixture_data; + grpc_endpoint_pair* sfd = 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)); @@ -53,13 +53,13 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { } typedef struct { - grpc_end2end_test_fixture *f; - grpc_channel_args *client_args; + grpc_end2end_test_fixture* f; + grpc_channel_args* client_args; } sp_client_setup; -static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport) { - sp_client_setup *cs = ts; +static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts, + grpc_transport* transport) { + sp_client_setup* cs = ts; cs->f->client = grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args, @@ -67,8 +67,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_channel_args* client_args, grpc_channel_args* server_args) { + grpc_endpoint_pair* sfd = gpr_malloc(sizeof(grpc_endpoint_pair)); grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); @@ -91,11 +91,11 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( return f; } -static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; sp_client_setup cs; cs.client_args = client_args; cs.f = f; @@ -107,11 +107,11 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { +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_transport *transport; + grpc_endpoint_pair* sfd = f->fixture_data; + grpc_transport* transport; GPR_ASSERT(!f->server); f->server = grpc_server_create(server_args, NULL); grpc_server_register_completion_queue(f->server, f->cq, NULL); @@ -123,7 +123,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx_finish(&exec_ctx); } -static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) { +static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } @@ -135,7 +135,7 @@ static grpc_end2end_test_config configs[] = { chttp2_tear_down_socketpair}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; g_fixture_slowdown_factor = 2; diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c index 0bac464e69..10e2ce04f5 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -35,14 +35,14 @@ #include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { - char *localaddr; + char* localaddr; } fullstack_secure_fixture_data; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - 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; int port = grpc_pick_unused_port_or_die(); - fullstack_secure_fixture_data *ffd = + fullstack_secure_fixture_data* ffd = gpr_malloc(sizeof(fullstack_secure_fixture_data)); memset(&f, 0, sizeof(f)); @@ -55,18 +55,18 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( return f; } -static void process_auth_failure(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, +static void process_auth_failure(void* state, grpc_auth_context* ctx, + const grpc_metadata* md, size_t md_count, grpc_process_auth_metadata_done_cb cb, - void *user_data) { + void* user_data) { GPR_ASSERT(state == NULL); cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); } 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; + grpc_end2end_test_fixture* f, grpc_channel_args* client_args, + grpc_channel_credentials* creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; f->client = grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL); GPR_ASSERT(f->client != NULL); @@ -74,9 +74,9 @@ 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; + grpc_end2end_test_fixture* f, grpc_channel_args* server_args, + grpc_server_credentials* server_creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -88,20 +88,20 @@ static void chttp2_init_server_secure_fullstack( grpc_server_start(f->server); } -void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { - fullstack_secure_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { + fullstack_secure_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } 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_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_channel_args *new_client_args = + 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); { @@ -111,7 +111,7 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( } } -static int fail_server_auth_check(grpc_channel_args *server_args) { +static int fail_server_auth_check(grpc_channel_args* server_args) { size_t i; if (server_args == NULL) return 0; for (i = 0; i < server_args->num_args; i++) { @@ -124,10 +124,10 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { } static void chttp2_init_server_simple_ssl_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { + grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials *ssl_creds = + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); if (fail_server_auth_check(server_args)) { grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; @@ -150,11 +150,11 @@ static grpc_end2end_test_config configs[] = { chttp2_tear_down_secure_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; - FILE *roots_file; + FILE* roots_file; size_t roots_size = strlen(test_root_cert); - char *roots_filename; + char* roots_filename; grpc_test_init(argc, argv); grpc_end2end_tests_pre_init(); diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index 8bc7183510..1530707f56 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -36,30 +36,30 @@ #include "test/core/util/test_config.h" typedef struct fullstack_secure_fixture_data { - grpc_end2end_proxy *proxy; + grpc_end2end_proxy* proxy; } fullstack_secure_fixture_data; -static grpc_server *create_proxy_server(const char *port, - grpc_channel_args *server_args) { - grpc_server *s = grpc_server_create(server_args, NULL); +static grpc_server* create_proxy_server(const char* port, + grpc_channel_args* server_args) { + grpc_server* s = grpc_server_create(server_args, NULL); grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials *ssl_creds = + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); GPR_ASSERT(grpc_server_add_secure_http2_port(s, port, ssl_creds)); grpc_server_credentials_release(ssl_creds); return s; } -static grpc_channel *create_proxy_client(const char *target, - grpc_channel_args *client_args) { - grpc_channel *channel; - grpc_channel_credentials *ssl_creds = +static grpc_channel* create_proxy_client(const char* target, + grpc_channel_args* client_args) { + 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_channel_args *new_client_args = + grpc_channel_args* new_client_args = grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1); channel = grpc_secure_channel_create(ssl_creds, target, new_client_args, NULL); @@ -76,9 +76,9 @@ static const grpc_end2end_proxy_def proxy_def = {create_proxy_server, create_proxy_client}; static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - 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; - fullstack_secure_fixture_data *ffd = + fullstack_secure_fixture_data* ffd = gpr_malloc(sizeof(fullstack_secure_fixture_data)); memset(&f, 0, sizeof(f)); @@ -91,18 +91,18 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( return f; } -static void process_auth_failure(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, +static void process_auth_failure(void* state, grpc_auth_context* ctx, + const grpc_metadata* md, size_t md_count, grpc_process_auth_metadata_done_cb cb, - void *user_data) { + void* user_data) { GPR_ASSERT(state == NULL); cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); } 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; + grpc_end2end_test_fixture* f, grpc_channel_args* client_args, + grpc_channel_credentials* creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; f->client = grpc_secure_channel_create( creds, grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, NULL); @@ -111,9 +111,9 @@ 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; + grpc_end2end_test_fixture* f, grpc_channel_args* server_args, + grpc_server_credentials* server_creds) { + fullstack_secure_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -125,20 +125,20 @@ static void chttp2_init_server_secure_fullstack( grpc_server_start(f->server); } -void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { - fullstack_secure_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) { + fullstack_secure_fixture_data* ffd = f->fixture_data; grpc_end2end_proxy_destroy(ffd->proxy); gpr_free(ffd); } 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_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_channel_args *new_client_args = + 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); { @@ -148,7 +148,7 @@ static void chttp2_init_client_simple_ssl_secure_fullstack( } } -static int fail_server_auth_check(grpc_channel_args *server_args) { +static int fail_server_auth_check(grpc_channel_args* server_args) { size_t i; if (server_args == NULL) return 0; for (i = 0; i < server_args->num_args; i++) { @@ -161,10 +161,10 @@ static int fail_server_auth_check(grpc_channel_args *server_args) { } static void chttp2_init_server_simple_ssl_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { + grpc_end2end_test_fixture* f, grpc_channel_args* server_args) { grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, test_server1_cert}; - grpc_server_credentials *ssl_creds = + grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); if (fail_server_auth_check(server_args)) { grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; @@ -188,11 +188,11 @@ static grpc_end2end_test_config configs[] = { chttp2_tear_down_secure_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; - FILE *roots_file; + FILE* roots_file; size_t roots_size = strlen(test_root_cert); - char *roots_filename; + char* roots_filename; grpc_test_init(argc, argv); grpc_end2end_tests_pre_init(); diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index 05a31985e7..b090f5d590 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -40,15 +40,15 @@ #include "test/core/util/test_config.h" typedef struct fullstack_fixture_data { - char *localaddr; + char* localaddr; } fullstack_fixture_data; static int unique = 1; static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( - 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; - fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); + fullstack_fixture_data* ffd = gpr_malloc(sizeof(fullstack_fixture_data)); memset(&f, 0, sizeof(f)); gpr_asprintf(&ffd->localaddr, "unix:/tmp/grpc_fullstack_test.%d.%d", getpid(), @@ -61,15 +61,15 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( return f; } -void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { + fullstack_fixture_data* ffd = 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; +void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { + fullstack_fixture_data* ffd = f->fixture_data; if (f->server) { grpc_server_destroy(f->server); } @@ -79,22 +79,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { - fullstack_fixture_data *ffd = f->fixture_data; +void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { + fullstack_fixture_data* ffd = f->fixture_data; gpr_free(ffd->localaddr); gpr_free(ffd); } /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_uds", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/inproc.c b/test/core/end2end/fixtures/inproc.c index 6f742f0293..02e8030dd0 100644 --- a/test/core/end2end/fixtures/inproc.c +++ b/test/core/end2end/fixtures/inproc.c @@ -40,9 +40,9 @@ typedef struct inproc_fixture_data { } inproc_fixture_data; static grpc_end2end_test_fixture inproc_create_fixture( - 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; - inproc_fixture_data *ffd = gpr_malloc(sizeof(inproc_fixture_data)); + inproc_fixture_data* ffd = gpr_malloc(sizeof(inproc_fixture_data)); memset(&f, 0, sizeof(f)); f.fixture_data = ffd; @@ -52,14 +52,14 @@ static grpc_end2end_test_fixture inproc_create_fixture( return f; } -void inproc_init_client(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args) { +void inproc_init_client(grpc_end2end_test_fixture* f, + grpc_channel_args* client_args) { f->client = grpc_inproc_channel_create(f->server, client_args, NULL); GPR_ASSERT(f->client); } -void inproc_init_server(grpc_end2end_test_fixture *f, - grpc_channel_args *server_args) { +void inproc_init_server(grpc_end2end_test_fixture* f, + grpc_channel_args* server_args) { if (f->server) { grpc_server_destroy(f->server); } @@ -68,8 +68,8 @@ void inproc_init_server(grpc_end2end_test_fixture *f, grpc_server_start(f->server); } -void inproc_tear_down(grpc_end2end_test_fixture *f) { - inproc_fixture_data *ffd = f->fixture_data; +void inproc_tear_down(grpc_end2end_test_fixture* f) { + inproc_fixture_data* ffd = f->fixture_data; gpr_free(ffd); } @@ -79,7 +79,7 @@ static grpc_end2end_test_config configs[] = { inproc_init_client, inproc_init_server, inproc_tear_down}, }; -int main(int argc, char **argv) { +int main(int argc, char** argv) { size_t i; grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index 6a2d75da09..01c9e13538 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -31,37 +31,37 @@ struct grpc_end2end_proxy { gpr_thd_id thd; - char *proxy_port; - char *server_port; - grpc_completion_queue *cq; - grpc_server *server; - grpc_channel *client; + char* proxy_port; + char* server_port; + grpc_completion_queue* cq; + grpc_server* server; + grpc_channel* client; int shutdown; /* requested call */ - grpc_call *new_call; + grpc_call* new_call; grpc_call_details new_call_details; grpc_metadata_array new_call_metadata; }; typedef struct { - void (*func)(void *arg, int success); - void *arg; + void (*func)(void* arg, int success); + void* arg; } closure; typedef struct { gpr_refcount refs; - grpc_end2end_proxy *proxy; + grpc_end2end_proxy* proxy; - grpc_call *c2p; - grpc_call *p2s; + grpc_call* c2p; + grpc_call* p2s; grpc_metadata_array c2p_initial_metadata; grpc_metadata_array p2s_initial_metadata; - grpc_byte_buffer *c2p_msg; - grpc_byte_buffer *p2s_msg; + grpc_byte_buffer* c2p_msg; + grpc_byte_buffer* p2s_msg; grpc_metadata_array p2s_trailing_metadata; grpc_status_code p2s_status; @@ -70,17 +70,17 @@ typedef struct { int c2p_server_cancelled; } proxy_call; -static void thread_main(void *arg); -static void request_call(grpc_end2end_proxy *proxy); +static void thread_main(void* arg); +static void request_call(grpc_end2end_proxy* proxy); -grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, - grpc_channel_args *client_args, - grpc_channel_args *server_args) { +grpc_end2end_proxy* grpc_end2end_proxy_create(const grpc_end2end_proxy_def* def, + grpc_channel_args* client_args, + grpc_channel_args* server_args) { gpr_thd_options opt = gpr_thd_options_default(); int proxy_port = grpc_pick_unused_port_or_die(); int server_port = grpc_pick_unused_port_or_die(); - grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)gpr_malloc(sizeof(*proxy)); + grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)gpr_malloc(sizeof(*proxy)); memset(proxy, 0, sizeof(*proxy)); gpr_join_host_port(&proxy->proxy_port, "localhost", proxy_port); @@ -105,20 +105,20 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, return proxy; } -static closure *new_closure(void (*func)(void *arg, int success), void *arg) { - closure *cl = (closure *)gpr_malloc(sizeof(*cl)); +static closure* new_closure(void (*func)(void* arg, int success), void* arg) { + closure* cl = (closure*)gpr_malloc(sizeof(*cl)); cl->func = func; cl->arg = arg; return cl; } -static void shutdown_complete(void *arg, int success) { - grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; +static void shutdown_complete(void* arg, int success) { + grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg; proxy->shutdown = 1; grpc_completion_queue_shutdown(proxy->cq); } -void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) { +void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy) { grpc_server_shutdown_and_notify(proxy->server, proxy->cq, new_closure(shutdown_complete, proxy)); gpr_thd_join(proxy->thd); @@ -131,7 +131,7 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) { gpr_free(proxy); } -static void unrefpc(proxy_call *pc, const char *reason) { +static void unrefpc(proxy_call* pc, const char* reason) { if (gpr_unref(&pc->refs)) { grpc_call_unref(pc->c2p); grpc_call_unref(pc->p2s); @@ -143,15 +143,15 @@ static void unrefpc(proxy_call *pc, const char *reason) { } } -static void refpc(proxy_call *pc, const char *reason) { gpr_ref(&pc->refs); } +static void refpc(proxy_call* pc, const char* reason) { gpr_ref(&pc->refs); } -static void on_c2p_sent_initial_metadata(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_c2p_sent_initial_metadata(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; unrefpc(pc, "on_c2p_sent_initial_metadata"); } -static void on_p2s_recv_initial_metadata(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_recv_initial_metadata(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -171,15 +171,15 @@ static void on_p2s_recv_initial_metadata(void *arg, int success) { unrefpc(pc, "on_p2s_recv_initial_metadata"); } -static void on_p2s_sent_initial_metadata(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_sent_initial_metadata(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; unrefpc(pc, "on_p2s_sent_initial_metadata"); } -static void on_c2p_recv_msg(void *arg, int success); +static void on_c2p_recv_msg(void* arg, int success); -static void on_p2s_sent_message(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_sent_message(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -198,13 +198,13 @@ static void on_p2s_sent_message(void *arg, int success) { unrefpc(pc, "on_p2s_sent_message"); } -static void on_p2s_sent_close(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_sent_close(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; unrefpc(pc, "on_p2s_sent_close"); } -static void on_c2p_recv_msg(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_c2p_recv_msg(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -236,10 +236,10 @@ static void on_c2p_recv_msg(void *arg, int success) { unrefpc(pc, "on_c2p_recv_msg"); } -static void on_p2s_recv_msg(void *arg, int success); +static void on_p2s_recv_msg(void* arg, int success); -static void on_c2p_sent_message(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_c2p_sent_message(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -258,8 +258,8 @@ static void on_c2p_sent_message(void *arg, int success) { unrefpc(pc, "on_c2p_sent_message"); } -static void on_p2s_recv_msg(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_recv_msg(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -278,13 +278,13 @@ static void on_p2s_recv_msg(void *arg, int success) { unrefpc(pc, "on_p2s_recv_msg"); } -static void on_c2p_sent_status(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_c2p_sent_status(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; unrefpc(pc, "on_c2p_sent_status"); } -static void on_p2s_status(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_p2s_status(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; grpc_op op; grpc_call_error err; @@ -308,19 +308,19 @@ static void on_p2s_status(void *arg, int success) { unrefpc(pc, "on_p2s_status"); } -static void on_c2p_closed(void *arg, int success) { - proxy_call *pc = (proxy_call *)arg; +static void on_c2p_closed(void* arg, int success) { + proxy_call* pc = (proxy_call*)arg; unrefpc(pc, "on_c2p_closed"); } -static void on_new_call(void *arg, int success) { - grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; +static void on_new_call(void* arg, int success) { + grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg; grpc_call_error err; if (success) { grpc_op op; memset(&op, 0, sizeof(op)); - proxy_call *pc = (proxy_call *)gpr_malloc(sizeof(*pc)); + proxy_call* pc = (proxy_call*)gpr_malloc(sizeof(*pc)); memset(pc, 0, sizeof(*pc)); pc->proxy = proxy; GPR_SWAP(grpc_metadata_array, pc->c2p_initial_metadata, @@ -398,7 +398,7 @@ static void on_new_call(void *arg, int success) { } } -static void request_call(grpc_end2end_proxy *proxy) { +static void request_call(grpc_end2end_proxy* proxy) { proxy->new_call = NULL; GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( proxy->server, &proxy->new_call, @@ -407,9 +407,9 @@ static void request_call(grpc_end2end_proxy *proxy) { proxy->cq, new_closure(on_new_call, proxy))); } -static void thread_main(void *arg) { - grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg; - closure *cl; +static void thread_main(void* arg) { + grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg; + closure* cl; for (;;) { grpc_event ev = grpc_completion_queue_next( proxy->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL); @@ -420,7 +420,7 @@ static void thread_main(void *arg) { case GRPC_QUEUE_SHUTDOWN: return; case GRPC_OP_COMPLETE: - cl = (closure *)ev.tag; + cl = (closure*)ev.tag; cl->func(cl->arg, ev.success); gpr_free(cl); break; @@ -428,10 +428,10 @@ static void thread_main(void *arg) { } } -const char *grpc_end2end_proxy_get_client_target(grpc_end2end_proxy *proxy) { +const char* grpc_end2end_proxy_get_client_target(grpc_end2end_proxy* proxy) { return proxy->proxy_port; } -const char *grpc_end2end_proxy_get_server_port(grpc_end2end_proxy *proxy) { +const char* grpc_end2end_proxy_get_server_port(grpc_end2end_proxy* proxy) { return proxy->server_port; } diff --git a/test/core/end2end/fixtures/proxy.h b/test/core/end2end/fixtures/proxy.h index 89b965c903..18ad763ea7 100644 --- a/test/core/end2end/fixtures/proxy.h +++ b/test/core/end2end/fixtures/proxy.h @@ -26,18 +26,18 @@ typedef struct grpc_end2end_proxy grpc_end2end_proxy; typedef struct grpc_end2end_proxy_def { - grpc_server *(*create_server)(const char *port, - grpc_channel_args *server_args); - grpc_channel *(*create_client)(const char *target, - grpc_channel_args *client_args); + grpc_server* (*create_server)(const char* port, + grpc_channel_args* server_args); + grpc_channel* (*create_client)(const char* target, + grpc_channel_args* client_args); } grpc_end2end_proxy_def; -grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, - grpc_channel_args *client_args, - grpc_channel_args *server_args); -void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy); +grpc_end2end_proxy* grpc_end2end_proxy_create(const grpc_end2end_proxy_def* def, + grpc_channel_args* client_args, + grpc_channel_args* server_args); +void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy); -const char *grpc_end2end_proxy_get_client_target(grpc_end2end_proxy *proxy); -const char *grpc_end2end_proxy_get_server_port(grpc_end2end_proxy *proxy); +const char* grpc_end2end_proxy_get_client_target(grpc_end2end_proxy* proxy); +const char* grpc_end2end_proxy_get_server_port(grpc_end2end_proxy* proxy); #endif /* GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H */ |