aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/fixtures
diff options
context:
space:
mode:
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)48
-rw-r--r--test/core/end2end/fixtures/h2_compress.cc (renamed from test/core/end2end/fixtures/h2_compress.c)57
-rw-r--r--test/core/end2end/fixtures/h2_fakesec.cc (renamed from test/core/end2end/fixtures/h2_fakesec.c)67
-rw-r--r--test/core/end2end/fixtures/h2_fd.cc (renamed from test/core/end2end/fixtures/h2_fd.c)37
-rw-r--r--test/core/end2end/fixtures/h2_full+pipe.cc (renamed from test/core/end2end/fixtures/h2_full+pipe.c)48
-rw-r--r--test/core/end2end/fixtures/h2_full+trace.cc (renamed from test/core/end2end/fixtures/h2_full+trace.c)46
-rw-r--r--test/core/end2end/fixtures/h2_full+workarounds.cc (renamed from test/core/end2end/fixtures/h2_full+workarounds.c)54
-rw-r--r--test/core/end2end/fixtures/h2_full.cc (renamed from test/core/end2end/fixtures/h2_full.c)46
-rw-r--r--test/core/end2end/fixtures/h2_http_proxy.cc (renamed from test/core/end2end/fixtures/h2_http_proxy.c)54
-rw-r--r--test/core/end2end/fixtures/h2_load_reporting.cc (renamed from test/core/end2end/fixtures/h2_load_reporting.c)40
-rw-r--r--test/core/end2end/fixtures/h2_oauth2.cc (renamed from test/core/end2end/fixtures/h2_oauth2.c)133
-rw-r--r--test/core/end2end/fixtures/h2_proxy.cc (renamed from test/core/end2end/fixtures/h2_proxy.c)59
-rw-r--r--test/core/end2end/fixtures/h2_sockpair+trace.cc (renamed from test/core/end2end/fixtures/h2_sockpair+trace.c)57
-rw-r--r--test/core/end2end/fixtures/h2_sockpair.cc (renamed from test/core/end2end/fixtures/h2_sockpair.c)57
-rw-r--r--test/core/end2end/fixtures/h2_sockpair_1byte.cc (renamed from test/core/end2end/fixtures/h2_sockpair_1byte.c)78
-rw-r--r--test/core/end2end/fixtures/h2_ssl.cc (renamed from test/core/end2end/fixtures/h2_ssl.c)88
-rw-r--r--test/core/end2end/fixtures/h2_ssl_proxy.cc (renamed from test/core/end2end/fixtures/h2_ssl_proxy.c)119
-rw-r--r--test/core/end2end/fixtures/h2_uds.cc (renamed from test/core/end2end/fixtures/h2_uds.c)46
-rw-r--r--test/core/end2end/fixtures/http_proxy_fixture.cc (renamed from test/core/end2end/fixtures/http_proxy_fixture.c)38
-rw-r--r--test/core/end2end/fixtures/inproc.cc (renamed from test/core/end2end/fixtures/inproc.c)29
-rw-r--r--test/core/end2end/fixtures/proxy.cc (renamed from test/core/end2end/fixtures/proxy.c)189
-rw-r--r--test/core/end2end/fixtures/proxy.h20
22 files changed, 758 insertions, 652 deletions
diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.cc
index 9870ccb34a..fed8ead5c8 100644
--- a/test/core/end2end/fixtures/h2_census.c
+++ b/test/core/end2end/fixtures/h2_census.cc
@@ -37,21 +37,22 @@
#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 = static_cast<fullstack_fixture_data*>(
+ gpr_malloc(sizeof(fullstack_fixture_data)));
memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
@@ -59,17 +60,19 @@ 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;
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ 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);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
GPR_ASSERT(f->client);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -78,41 +81,44 @@ 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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
grpc_arg arg = make_census_enable_arg();
if (f->server) {
grpc_server_destroy(f->server);
}
server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
- f->server = grpc_server_create(server_args, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_args_destroy(&exec_ctx, server_args);
grpc_exec_ctx_finish(&exec_ctx);
}
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<fullstack_fixture_data*>(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.cc
index 9866dea7eb..ea8990fd0a 100644
--- a/test/core/end2end/fixtures/h2_compress.c
+++ b/test/core/end2end/fixtures/h2_compress.cc
@@ -37,47 +37,50 @@
#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 =
- gpr_malloc(sizeof(fullstack_compression_fixture_data));
+ fullstack_compression_fixture_data* ffd =
+ 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);
memset(&f, 0, sizeof(f));
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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;
- if (ffd->client_args_compression != NULL) {
+void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_compression_fixture_data* ffd =
+ static_cast<fullstack_compression_fixture_data*>(f->fixture_data);
+ if (ffd->client_args_compression != nullptr) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression);
grpc_exec_ctx_finish(&exec_ctx);
}
ffd->client_args_compression = grpc_channel_args_set_compression_algorithm(
client_args, GRPC_COMPRESS_GZIP);
- f->client = grpc_insecure_channel_create(ffd->localaddr,
- ffd->client_args_compression, NULL);
+ f->client = grpc_insecure_channel_create(
+ ffd->localaddr, ffd->client_args_compression, nullptr);
}
-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) {
+void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f,
+ grpc_channel_args* server_args) {
+ fullstack_compression_fixture_data* ffd =
+ static_cast<fullstack_compression_fixture_data*>(f->fixture_data);
+ if (ffd->server_args_compression != nullptr) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression);
grpc_exec_ctx_finish(&exec_ctx);
@@ -87,15 +90,16 @@ void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f,
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(ffd->server_args_compression, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(ffd->server_args_compression, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ 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);
@@ -105,16 +109,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.cc
index e622d952be..87d4668d50 100644
--- a/test/core/end2end/fixtures/h2_fakesec.c
+++ b/test/core/end2end/fixtures/h2_fakesec.cc
@@ -31,75 +31,79 @@
#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 =
- gpr_malloc(sizeof(fullstack_secure_fixture_data));
+ fullstack_secure_fixture_data* ffd =
+ 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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) {
- GPR_ASSERT(state == NULL);
- cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+ void* user_data) {
+ GPR_ASSERT(state == nullptr);
+ cb(user_data, nullptr, 0, nullptr, 0, GRPC_STATUS_UNAUTHENTICATED, nullptr);
}
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 =
+ 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);
+ grpc_secure_channel_create(creds, ffd->localaddr, client_args, nullptr);
+ GPR_ASSERT(f->client != nullptr);
grpc_channel_credentials_release(creds);
}
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 =
+ static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
server_creds));
grpc_server_credentials_release(server_creds);
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 =
+ static_cast<fullstack_secure_fixture_data*>(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;
+ if (server_args == nullptr) return 0;
for (i = 0; i < server_args->num_args; i++) {
if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
0) {
@@ -110,11 +114,12 @@ 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};
+ grpc_auth_metadata_processor processor = {process_auth_failure, nullptr,
+ nullptr};
grpc_server_credentials_set_auth_metadata_processor(fake_ts_creds,
processor);
}
@@ -135,7 +140,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.cc
index e82c120221..97f4b71bf0 100644
--- a/test/core/end2end/fixtures/h2_fd.c
+++ b/test/core/end2end/fixtures/h2_fd.cc
@@ -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,24 +51,25 @@ 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 =
+ static_cast<sp_fixture_data*>(gpr_malloc(sizeof(*fixture_data)));
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
create_sockets(fixture_data->fd_pair);
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 = static_cast<sp_fixture_data*>(f->fixture_data);
GPR_ASSERT(!f->client);
f->client = grpc_insecure_channel_create_from_fd(
@@ -76,22 +79,22 @@ 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 = static_cast<sp_fixture_data*>(f->fixture_data);
GPR_ASSERT(!f->server);
- f->server = grpc_server_create(server_args, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
GPR_ASSERT(f->server);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
grpc_server_start(f->server);
- grpc_server_add_insecure_channel_from_fd(f->server, NULL, sfd->fd_pair[1]);
+ grpc_server_add_insecure_channel_from_fd(f->server, nullptr, sfd->fd_pair[1]);
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 +105,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 +123,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.cc
index c764bd704a..b080591e85 100644
--- a/test/core/end2end/fixtures/h2_full+pipe.c
+++ b/test/core/end2end/fixtures/h2_full+pipe.cc
@@ -42,60 +42,66 @@
#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 = static_cast<fullstack_fixture_data*>(
+ gpr_malloc(sizeof(fullstack_fixture_data)));
memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_fixture_data* ffd =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<fullstack_fixture_data*>(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 +121,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.cc
index 7eb29e0d32..a49de96009 100644
--- a/test/core/end2end/fixtures/h2_full+trace.c
+++ b/test/core/end2end/fixtures/h2_full+trace.cc
@@ -42,60 +42,66 @@
#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 = static_cast<fullstack_fixture_data*>(
+ gpr_malloc(sizeof(fullstack_fixture_data)));
memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_fixture_data* ffd =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<fullstack_fixture_data*>(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.cc
index a98e5ad57f..71a497d796 100644
--- a/test/core/end2end/fixtures/h2_full+workarounds.c
+++ b/test/core/end2end/fixtures/h2_full+workarounds.cc
@@ -36,77 +36,83 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-static char *workarounds_arg[GRPC_MAX_WORKAROUND_ID] = {
- GRPC_ARG_WORKAROUND_CRONET_COMPRESSION};
+static char* workarounds_arg[GRPC_MAX_WORKAROUND_ID] = {
+ const_cast<char*>(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 = static_cast<fullstack_fixture_data*>(
+ gpr_malloc(sizeof(fullstack_fixture_data)));
memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_fixture_data* ffd =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
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 =
+ 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];
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);
}
- f->server = grpc_server_create(server_args_new, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args_new, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
grpc_channel_args_destroy(&exec_ctx, server_args_new);
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 =
+ static_cast<fullstack_fixture_data*>(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.cc
index ae68bd9698..6d15c28662 100644
--- a/test/core/end2end/fixtures/h2_full.c
+++ b/test/core/end2end/fixtures/h2_full.cc
@@ -36,60 +36,66 @@
#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 = static_cast<fullstack_fixture_data*>(
+ gpr_malloc(sizeof(fullstack_fixture_data)));
memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_fixture_data* ffd =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<fullstack_fixture_data*>(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.cc
index 6145892365..099367d91b 100644
--- a/test/core/end2end/fixtures/h2_http_proxy.c
+++ b/test/core/end2end/fixtures/h2_http_proxy.cc
@@ -39,15 +39,16 @@
#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 = 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);
@@ -56,21 +57,22 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
ffd->proxy = grpc_end2end_http_proxy_create(client_args);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(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) {
+ if (proxy_auth_arg == nullptr || proxy_auth_arg->type != GRPC_ARG_STRING) {
gpr_asprintf(&proxy_uri, "http://%s",
grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
} else {
@@ -79,24 +81,27 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
}
gpr_setenv("http_proxy", proxy_uri);
gpr_free(proxy_uri);
- f->client = grpc_insecure_channel_create(ffd->server_addr, client_args, NULL);
+ f->client =
+ grpc_insecure_channel_create(ffd->server_addr, client_args, nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->server_addr));
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
gpr_free(ffd->server_addr);
grpc_end2end_http_proxy_destroy(ffd->proxy);
gpr_free(ffd);
@@ -104,14 +109,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.cc
index 8a05bb722a..7486b6af78 100644
--- a/test/core/end2end/fixtures/h2_load_reporting.c
+++ b/test/core/end2end/fixtures/h2_load_reporting.cc
@@ -38,54 +38,58 @@
#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 =
- 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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;
- f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ load_reporting_fixture_data* ffd =
+ static_cast<load_reporting_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
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 =
+ 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);
}
server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
- f->server = grpc_server_create(server_args, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_args_destroy(&exec_ctx, server_args);
grpc_exec_ctx_finish(&exec_ctx);
}
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<load_reporting_fixture_data*>(f->fixture_data);
gpr_free(ffd->localaddr);
gpr_free(ffd);
}
@@ -100,7 +104,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.cc
index ee1d0b1416..1642cb0db9 100644
--- a/test/core/end2end/fixtures/h2_oauth2.c
+++ b/test/core/end2end/fixtures/h2_oauth2.cc
@@ -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 &&
@@ -49,105 +49,113 @@ static const grpc_metadata *find_metadata(const grpc_metadata *md,
return &md[i];
}
}
- return NULL;
+ return nullptr;
}
-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;
+ GPR_ASSERT(state != nullptr);
+ s = (test_processor_state*)state;
GPR_ASSERT(s->pseudo_refcount == 1);
- GPR_ASSERT(oauth2 != NULL);
+ GPR_ASSERT(oauth2 != nullptr);
grpc_auth_context_add_cstring_property(ctx, client_identity_property_name,
client_identity);
GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(
ctx, client_identity_property_name) == 1);
- cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_OK, NULL);
+ cb(user_data, oauth2, 1, nullptr, 0, GRPC_STATUS_OK, nullptr);
}
-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;
- GPR_ASSERT(state != NULL);
- s = (test_processor_state *)state;
+ test_processor_state* s;
+ GPR_ASSERT(state != nullptr);
+ 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);
+ GPR_ASSERT(oauth2 != nullptr);
+ cb(user_data, oauth2, 1, nullptr, 0, GRPC_STATUS_UNAUTHENTICATED, nullptr);
}
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 =
- gpr_malloc(sizeof(fullstack_secure_fixture_data));
+ fullstack_secure_fixture_data* ffd =
+ 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
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 =
+ 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);
+ grpc_secure_channel_create(creds, ffd->localaddr, client_args, nullptr);
+ GPR_ASSERT(f->client != nullptr);
grpc_channel_credentials_release(creds);
}
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 =
+ static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
server_creds));
grpc_server_credentials_release(server_creds);
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 =
+ static_cast<fullstack_secure_fixture_data*>(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_ssl_credentials_create(test_root_cert, NULL, NULL);
- grpc_call_credentials *oauth2_creds = grpc_md_only_test_credentials_create(
+ grpc_channel_credentials* ssl_creds =
+ grpc_ssl_credentials_create(test_root_cert, nullptr, nullptr);
+ grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create(
&exec_ctx, "authorization", oauth2_md, true /* is_async */);
- grpc_channel_credentials *ssl_oauth2_creds =
- grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, 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_credentials* ssl_oauth2_creds =
+ grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds,
+ nullptr);
+ 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);
grpc_channel_args_destroy(&exec_ctx, new_client_args);
@@ -156,9 +164,9 @@ 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;
+ if (server_args == nullptr) return 0;
for (i = 0; i < server_args->num_args; i++) {
if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
0) {
@@ -168,14 +176,15 @@ 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 =
+ static_cast<test_processor_state*>(gpr_malloc(sizeof(*s)));
grpc_auth_metadata_processor result;
s->pseudo_refcount = 1;
result.state = s;
@@ -189,11 +198,11 @@ 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_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
+ grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+ nullptr, &pem_key_cert_pair, 1, 0, nullptr);
grpc_server_credentials_set_auth_metadata_processor(
ssl_creds, test_processor_create(fail_server_auth_check(server_args)));
chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
@@ -213,7 +222,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.cc
index 069130baf4..295654cb6a 100644
--- a/test/core/end2end/fixtures/h2_proxy.c
+++ b/test/core/end2end/fixtures/h2_proxy.cc
@@ -37,77 +37,82 @@
#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, nullptr);
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) {
- return grpc_insecure_channel_create(target, client_args, NULL);
+static grpc_channel* create_proxy_client(const char* target,
+ grpc_channel_args* client_args) {
+ return grpc_insecure_channel_create(target, client_args, nullptr);
}
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 = 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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 =
+ 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);
+ grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, nullptr);
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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(
f->server, grpc_end2end_proxy_get_server_port(ffd->proxy)));
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 =
+ static_cast<fullstack_fixture_data*>(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.cc
index 39ccb84b52..fe4ab74843 100644
--- a/test/core/end2end/fixtures/h2_sockpair+trace.c
+++ b/test/core/end2end/fixtures/h2_sockpair+trace.cc
@@ -48,24 +48,24 @@
/* 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 = 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_setup_transport(&exec_ctx, f->server, transport, nullptr,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
}
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 = static_cast<sp_client_setup*>(ts);
cs->f->client =
grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
@@ -73,25 +73,26 @@ 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 =
+ static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
- *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
+ *sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr);
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 = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+ grpc_transport* transport;
sp_client_setup cs;
cs.client_args = client_args;
cs.f = f;
@@ -99,27 +100,27 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 = static_cast<grpc_endpoint_pair*>(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);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
server_setup_transport(f, transport);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 +131,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.cc
index 03566ead9b..59a3a6db31 100644
--- a/test/core/end2end/fixtures/h2_sockpair.c
+++ b/test/core/end2end/fixtures/h2_sockpair.cc
@@ -42,24 +42,24 @@
/* 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 = 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_setup_transport(&exec_ctx, f->server, transport, nullptr,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
}
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 = static_cast<sp_client_setup*>(ts);
cs->f->client =
grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
@@ -67,25 +67,26 @@ 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 =
+ static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
- *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
+ *sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr);
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 = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+ grpc_transport* transport;
sp_client_setup cs;
cs.client_args = client_args;
cs.f = f;
@@ -93,27 +94,27 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 = static_cast<grpc_endpoint_pair*>(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);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
server_setup_transport(f, transport);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 +125,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.cc
index c75a3876d5..d935efbbac 100644
--- a/test/core/end2end/fixtures/h2_sockpair_1byte.c
+++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc
@@ -42,24 +42,24 @@
/* 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 = 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_setup_transport(&exec_ctx, f->server, transport, nullptr,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
}
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 = static_cast<sp_client_setup*>(ts);
cs->f->client =
grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
@@ -67,35 +67,37 @@ 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 =
+ static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- 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};
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
+
+ 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;
}
-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 = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+ grpc_transport* transport;
sp_client_setup cs;
cs.client_args = client_args;
cs.f = f;
@@ -103,27 +105,27 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 = static_cast<grpc_endpoint_pair*>(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);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
server_setup_transport(f, transport);
- grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, nullptr);
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 +137,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.cc
index 0bac464e69..3d7e2e327e 100644
--- a/test/core/end2end/fixtures/h2_ssl.c
+++ b/test/core/end2end/fixtures/h2_ssl.cc
@@ -35,73 +35,78 @@
#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 =
- gpr_malloc(sizeof(fullstack_secure_fixture_data));
+ fullstack_secure_fixture_data* ffd =
+ 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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) {
- GPR_ASSERT(state == NULL);
- cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+ void* user_data) {
+ GPR_ASSERT(state == nullptr);
+ cb(user_data, nullptr, 0, nullptr, 0, GRPC_STATUS_UNAUTHENTICATED, nullptr);
}
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 =
+ 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);
+ grpc_secure_channel_create(creds, ffd->localaddr, client_args, nullptr);
+ GPR_ASSERT(f->client != nullptr);
grpc_channel_credentials_release(creds);
}
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 =
+ static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
server_creds));
grpc_server_credentials_release(server_creds);
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 =
+ static_cast<fullstack_secure_fixture_data*>(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_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_end2end_test_fixture* f, grpc_channel_args* client_args) {
+ grpc_channel_credentials* ssl_creds =
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ 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);
{
@@ -111,9 +116,9 @@ 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;
+ if (server_args == nullptr) return 0;
for (i = 0; i < server_args->num_args; i++) {
if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
0) {
@@ -124,13 +129,14 @@ 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_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+ grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+ nullptr, &pem_cert_key_pair, 1, 0, nullptr);
if (fail_server_auth_check(server_args)) {
- grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
+ grpc_auth_metadata_processor processor = {process_auth_failure, nullptr,
+ nullptr};
grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
}
chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
@@ -150,19 +156,19 @@ 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();
/* Set the SSL roots env var. */
roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
- GPR_ASSERT(roots_filename != NULL);
- GPR_ASSERT(roots_file != NULL);
+ GPR_ASSERT(roots_filename != nullptr);
+ GPR_ASSERT(roots_file != nullptr);
GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
fclose(roots_file);
gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.cc
index 8bc7183510..f8d5a699e4 100644
--- a/test/core/end2end/fixtures/h2_ssl_proxy.c
+++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc
@@ -36,33 +36,34 @@
#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, nullptr);
grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
test_server1_cert};
- grpc_server_credentials *ssl_creds =
- grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+ grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+ nullptr, &pem_cert_key_pair, 1, 0, nullptr);
GPR_ASSERT(grpc_server_add_secure_http2_port(s, port, ssl_creds));
grpc_server_credentials_release(ssl_creds);
return s;
}
-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 =
+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(nullptr, nullptr, nullptr);
+ 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 =
- grpc_secure_channel_create(ssl_creds, target, new_client_args, NULL);
+ grpc_secure_channel_create(ssl_creds, target, new_client_args, nullptr);
grpc_channel_credentials_release(ssl_creds);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -76,69 +77,74 @@ 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 =
- gpr_malloc(sizeof(fullstack_secure_fixture_data));
+ fullstack_secure_fixture_data* ffd =
+ 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);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
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) {
- GPR_ASSERT(state == NULL);
- cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+ void* user_data) {
+ GPR_ASSERT(state == nullptr);
+ cb(user_data, nullptr, 0, nullptr, 0, GRPC_STATUS_UNAUTHENTICATED, nullptr);
}
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 =
+ 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);
- GPR_ASSERT(f->client != NULL);
+ nullptr);
+ GPR_ASSERT(f->client != nullptr);
grpc_channel_credentials_release(creds);
}
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 =
+ static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_secure_http2_port(
f->server, grpc_end2end_proxy_get_server_port(ffd->proxy), server_creds));
grpc_server_credentials_release(server_creds);
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 =
+ static_cast<fullstack_secure_fixture_data*>(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_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_end2end_test_fixture* f, grpc_channel_args* client_args) {
+ grpc_channel_credentials* ssl_creds =
+ grpc_ssl_credentials_create(nullptr, nullptr, nullptr);
+ 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);
{
@@ -148,9 +154,9 @@ 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;
+ if (server_args == nullptr) return 0;
for (i = 0; i < server_args->num_args; i++) {
if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
0) {
@@ -161,13 +167,14 @@ 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_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+ grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+ nullptr, &pem_cert_key_pair, 1, 0, nullptr);
if (fail_server_auth_check(server_args)) {
- grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
+ grpc_auth_metadata_processor processor = {process_auth_failure, nullptr,
+ nullptr};
grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
}
chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
@@ -188,19 +195,19 @@ 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();
/* Set the SSL roots env var. */
roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
- GPR_ASSERT(roots_filename != NULL);
- GPR_ASSERT(roots_file != NULL);
+ GPR_ASSERT(roots_filename != nullptr);
+ GPR_ASSERT(roots_file != nullptr);
GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
fclose(roots_file);
gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.cc
index 05a31985e7..28f0a50e15 100644
--- a/test/core/end2end/fixtures/h2_uds.c
+++ b/test/core/end2end/fixtures/h2_uds.cc
@@ -40,61 +40,67 @@
#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 = 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(),
unique++);
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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_client_fullstack(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ fullstack_fixture_data* ffd =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
+ f->client =
+ grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
}
-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 =
+ static_cast<fullstack_fixture_data*>(f->fixture_data);
if (f->server) {
grpc_server_destroy(f->server);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
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 =
+ static_cast<fullstack_fixture_data*>(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/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.cc
index d29401fdc3..ac0c953a79 100644
--- a/test/core/end2end/fixtures/http_proxy_fixture.c
+++ b/test/core/end2end/fixtures/http_proxy_fixture.cc
@@ -88,9 +88,11 @@ typedef struct proxy_connection {
grpc_slice_buffer client_read_buffer;
grpc_slice_buffer client_deferred_write_buffer;
+ bool client_is_writing;
grpc_slice_buffer client_write_buffer;
grpc_slice_buffer server_read_buffer;
grpc_slice_buffer server_deferred_write_buffer;
+ bool server_is_writing;
grpc_slice_buffer server_write_buffer;
grpc_http_parser http_parser;
@@ -108,7 +110,7 @@ static void proxy_connection_unref(grpc_exec_ctx* exec_ctx,
gpr_log(GPR_DEBUG, "endpoints: %p %p", conn->client_endpoint,
conn->server_endpoint);
grpc_endpoint_destroy(exec_ctx, conn->client_endpoint);
- if (conn->server_endpoint != NULL) {
+ if (conn->server_endpoint != nullptr) {
grpc_endpoint_destroy(exec_ctx, conn->server_endpoint);
}
grpc_pollset_set_destroy(exec_ctx, conn->pollset_set);
@@ -137,7 +139,7 @@ static void proxy_connection_failed(grpc_exec_ctx* exec_ctx,
grpc_endpoint_shutdown(exec_ctx, conn->client_endpoint,
GRPC_ERROR_REF(error));
- if (conn->server_endpoint != NULL) {
+ if (conn->server_endpoint != nullptr) {
grpc_endpoint_shutdown(exec_ctx, conn->server_endpoint,
GRPC_ERROR_REF(error));
}
@@ -148,6 +150,7 @@ static void proxy_connection_failed(grpc_exec_ctx* exec_ctx,
static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error* error) {
proxy_connection* conn = (proxy_connection*)arg;
+ conn->client_is_writing = false;
if (error != GRPC_ERROR_NONE) {
proxy_connection_failed(exec_ctx, conn, true /* is_client */,
"HTTP proxy client write", error);
@@ -160,6 +163,7 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg,
if (conn->client_deferred_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->client_deferred_write_buffer,
&conn->client_write_buffer);
+ conn->client_is_writing = true;
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
&conn->on_client_write_done);
@@ -173,6 +177,7 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg,
static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error* error) {
proxy_connection* conn = (proxy_connection*)arg;
+ conn->server_is_writing = false;
if (error != GRPC_ERROR_NONE) {
proxy_connection_failed(exec_ctx, conn, false /* is_client */,
"HTTP proxy server write", error);
@@ -185,6 +190,7 @@ static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg,
if (conn->server_deferred_write_buffer.length > 0) {
grpc_slice_buffer_move_into(&conn->server_deferred_write_buffer,
&conn->server_write_buffer);
+ conn->server_is_writing = true;
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
&conn->server_write_buffer,
&conn->on_server_write_done);
@@ -210,13 +216,14 @@ static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg,
// the current write is finished.
//
// Otherwise, move the read data into the write buffer and write it.
- if (conn->server_write_buffer.length > 0) {
+ if (conn->server_is_writing) {
grpc_slice_buffer_move_into(&conn->client_read_buffer,
&conn->server_deferred_write_buffer);
} else {
grpc_slice_buffer_move_into(&conn->client_read_buffer,
&conn->server_write_buffer);
proxy_connection_ref(conn, "client_read");
+ conn->server_is_writing = true;
grpc_endpoint_write(exec_ctx, conn->server_endpoint,
&conn->server_write_buffer,
&conn->on_server_write_done);
@@ -242,13 +249,14 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg,
// the current write is finished.
//
// Otherwise, move the read data into the write buffer and write it.
- if (conn->client_write_buffer.length > 0) {
+ if (conn->client_is_writing) {
grpc_slice_buffer_move_into(&conn->server_read_buffer,
&conn->client_deferred_write_buffer);
} else {
grpc_slice_buffer_move_into(&conn->server_read_buffer,
&conn->client_write_buffer);
proxy_connection_ref(conn, "server_read");
+ conn->client_is_writing = true;
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
&conn->on_client_write_done);
@@ -262,6 +270,7 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg,
static void on_write_response_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error* error) {
proxy_connection* conn = (proxy_connection*)arg;
+ conn->client_is_writing = false;
if (error != GRPC_ERROR_NONE) {
proxy_connection_failed(exec_ctx, conn, true /* is_client */,
"HTTP proxy write response", error);
@@ -302,6 +311,7 @@ static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_slice slice =
grpc_slice_from_copied_string("HTTP/1.0 200 connected\r\n\r\n");
grpc_slice_buffer_add(&conn->client_write_buffer, slice);
+ conn->client_is_writing = true;
grpc_endpoint_write(exec_ctx, conn->client_endpoint,
&conn->client_write_buffer,
&conn->on_write_response_done);
@@ -315,8 +325,8 @@ static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg,
static bool proxy_auth_header_matches(grpc_exec_ctx* exec_ctx,
char* proxy_auth_header_val,
char* expected_cred) {
- GPR_ASSERT(proxy_auth_header_val != NULL);
- GPR_ASSERT(expected_cred != NULL);
+ GPR_ASSERT(proxy_auth_header_val != nullptr);
+ GPR_ASSERT(expected_cred != nullptr);
if (strncmp(proxy_auth_header_val, "Basic ", 6) != 0) {
return false;
}
@@ -348,8 +358,8 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
// Read request and feed it to the parser.
for (size_t i = 0; i < conn->client_read_buffer.count; ++i) {
if (GRPC_SLICE_LENGTH(conn->client_read_buffer.slices[i]) > 0) {
- error = grpc_http_parser_parse(&conn->http_parser,
- conn->client_read_buffer.slices[i], NULL);
+ error = grpc_http_parser_parse(
+ &conn->http_parser, conn->client_read_buffer.slices[i], nullptr);
if (error != GRPC_ERROR_NONE) {
proxy_connection_failed(exec_ctx, conn, true /* is_client */,
"HTTP proxy request parse", error);
@@ -380,7 +390,7 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
// If proxy auth is being used, check if the header is present and as expected
const grpc_arg* proxy_auth_arg = grpc_channel_args_find(
conn->proxy->channel_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
- if (proxy_auth_arg != NULL && proxy_auth_arg->type == GRPC_ARG_STRING) {
+ if (proxy_auth_arg != nullptr && proxy_auth_arg->type == GRPC_ARG_STRING) {
bool client_authenticated = false;
for (size_t i = 0; i < conn->http_request.hdr_count; i++) {
if (strcmp(conn->http_request.hdrs[i].key, "Proxy-Authorization") == 0) {
@@ -400,7 +410,7 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
}
}
// Resolve address.
- grpc_resolved_addresses* resolved_addresses = NULL;
+ grpc_resolved_addresses* resolved_addresses = nullptr;
error = grpc_blocking_resolve_address(conn->http_request.path, "80",
&resolved_addresses);
if (error != GRPC_ERROR_NONE) {
@@ -415,7 +425,7 @@ static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg,
const grpc_millis deadline =
grpc_exec_ctx_now(exec_ctx) + 10 * GPR_MS_PER_SEC;
grpc_tcp_client_connect(exec_ctx, &conn->on_server_connect_done,
- &conn->server_endpoint, conn->pollset_set, NULL,
+ &conn->server_endpoint, conn->pollset_set, nullptr,
&resolved_addresses->addrs[0], deadline);
grpc_resolved_addresses_destroy(resolved_addresses);
}
@@ -450,9 +460,11 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg,
grpc_combiner_scheduler(conn->proxy->combiner));
grpc_slice_buffer_init(&conn->client_read_buffer);
grpc_slice_buffer_init(&conn->client_deferred_write_buffer);
+ conn->client_is_writing = false;
grpc_slice_buffer_init(&conn->client_write_buffer);
grpc_slice_buffer_init(&conn->server_read_buffer);
grpc_slice_buffer_init(&conn->server_deferred_write_buffer);
+ conn->server_is_writing = false;
grpc_slice_buffer_init(&conn->server_write_buffer);
grpc_http_parser_init(&conn->http_parser, GRPC_HTTP_REQUEST,
&conn->http_request);
@@ -469,7 +481,7 @@ static void thread_main(void* arg) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
do {
gpr_ref(&proxy->users);
- grpc_pollset_worker* worker = NULL;
+ grpc_pollset_worker* worker = nullptr;
gpr_mu_lock(proxy->mu);
GRPC_LOG_IF_ERROR(
"grpc_pollset_work",
@@ -496,7 +508,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(
// Create TCP server.
proxy->channel_args = grpc_channel_args_copy(args);
grpc_error* error = grpc_tcp_server_create(
- &exec_ctx, NULL, proxy->channel_args, &proxy->server);
+ &exec_ctx, nullptr, proxy->channel_args, &proxy->server);
GPR_ASSERT(error == GRPC_ERROR_NONE);
// Bind to port.
grpc_resolved_address resolved_addr;
diff --git a/test/core/end2end/fixtures/inproc.c b/test/core/end2end/fixtures/inproc.cc
index 6f742f0293..b748fbf09a 100644
--- a/test/core/end2end/fixtures/inproc.c
+++ b/test/core/end2end/fixtures/inproc.cc
@@ -40,36 +40,37 @@ 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 = static_cast<inproc_fixture_data*>(
+ gpr_malloc(sizeof(inproc_fixture_data)));
memset(&f, 0, sizeof(f));
f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(NULL);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+ f.cq = grpc_completion_queue_create_for_next(nullptr);
+ f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
return f;
}
-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);
+void inproc_init_client(grpc_end2end_test_fixture* f,
+ grpc_channel_args* client_args) {
+ f->client = grpc_inproc_channel_create(f->server, client_args, nullptr);
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);
}
- f->server = grpc_server_create(server_args, NULL);
- grpc_server_register_completion_queue(f->server, f->cq, NULL);
+ f->server = grpc_server_create(server_args, nullptr);
+ grpc_server_register_completion_queue(f->server, f->cq, nullptr);
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 = static_cast<inproc_fixture_data*>(f->fixture_data);
gpr_free(ffd);
}
@@ -79,7 +80,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.cc
index 6a2d75da09..2fab62b721 100644
--- a/test/core/end2end/fixtures/proxy.c
+++ b/test/core/end2end/fixtures/proxy.cc
@@ -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);
@@ -89,11 +89,11 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def,
gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port,
proxy->server_port);
- proxy->cq = grpc_completion_queue_create_for_next(NULL);
+ proxy->cq = grpc_completion_queue_create_for_next(nullptr);
proxy->server = def->create_server(proxy->proxy_port, server_args);
proxy->client = def->create_client(proxy->server_port, client_args);
- grpc_server_register_completion_queue(proxy->server, proxy->cq, NULL);
+ grpc_server_register_completion_queue(proxy->server, proxy->cq, nullptr);
grpc_server_start(proxy->server);
grpc_call_details_init(&proxy->new_call_details);
@@ -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;
@@ -159,27 +159,28 @@ static void on_p2s_recv_initial_metadata(void *arg, int success) {
if (!pc->proxy->shutdown) {
op.op = GRPC_OP_SEND_INITIAL_METADATA;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.send_initial_metadata.count = pc->p2s_initial_metadata.count;
op.data.send_initial_metadata.metadata = pc->p2s_initial_metadata.metadata;
refpc(pc, "on_c2p_sent_initial_metadata");
- err = grpc_call_start_batch(
- pc->c2p, &op, 1, new_closure(on_c2p_sent_initial_metadata, pc), NULL);
+ err = grpc_call_start_batch(pc->c2p, &op, 1,
+ new_closure(on_c2p_sent_initial_metadata, pc),
+ nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
}
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;
@@ -187,48 +188,48 @@ static void on_p2s_sent_message(void *arg, int success) {
if (!pc->proxy->shutdown && success) {
op.op = GRPC_OP_RECV_MESSAGE;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.recv_message.recv_message = &pc->c2p_msg;
refpc(pc, "on_c2p_recv_msg");
err = grpc_call_start_batch(pc->c2p, &op, 1,
- new_closure(on_c2p_recv_msg, pc), NULL);
+ new_closure(on_c2p_recv_msg, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
}
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;
if (!pc->proxy->shutdown && success) {
- if (pc->c2p_msg != NULL) {
+ if (pc->c2p_msg != nullptr) {
op.op = GRPC_OP_SEND_MESSAGE;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.send_message.send_message = pc->c2p_msg;
refpc(pc, "on_p2s_sent_message");
- err = grpc_call_start_batch(pc->p2s, &op, 1,
- new_closure(on_p2s_sent_message, pc), NULL);
+ err = grpc_call_start_batch(
+ pc->p2s, &op, 1, new_closure(on_p2s_sent_message, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
} else {
op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
refpc(pc, "on_p2s_sent_close");
err = grpc_call_start_batch(pc->p2s, &op, 1,
- new_closure(on_p2s_sent_close, pc), NULL);
+ new_closure(on_p2s_sent_close, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
}
} else {
- if (pc->c2p_msg != NULL) {
+ if (pc->c2p_msg != nullptr) {
grpc_byte_buffer_destroy(pc->c2p_msg);
}
}
@@ -236,10 +237,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;
@@ -247,30 +248,30 @@ static void on_c2p_sent_message(void *arg, int success) {
if (!pc->proxy->shutdown && success) {
op.op = GRPC_OP_RECV_MESSAGE;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.recv_message.recv_message = &pc->p2s_msg;
refpc(pc, "on_p2s_recv_msg");
err = grpc_call_start_batch(pc->p2s, &op, 1,
- new_closure(on_p2s_recv_msg, pc), NULL);
+ new_closure(on_p2s_recv_msg, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
}
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;
if (!pc->proxy->shutdown && success && pc->p2s_msg) {
op.op = GRPC_OP_SEND_MESSAGE;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.send_message.send_message = pc->p2s_msg;
refpc(pc, "on_c2p_sent_message");
err = grpc_call_start_batch(pc->c2p, &op, 1,
- new_closure(on_c2p_sent_message, pc), NULL);
+ new_closure(on_c2p_sent_message, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
} else {
grpc_byte_buffer_destroy(pc->p2s_msg);
@@ -278,13 +279,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;
@@ -292,7 +293,7 @@ static void on_p2s_status(void *arg, int success) {
GPR_ASSERT(success);
op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op.flags = 0;
- op.reserved = NULL;
+ op.reserved = nullptr;
op.data.send_status_from_server.trailing_metadata_count =
pc->p2s_trailing_metadata.count;
op.data.send_status_from_server.trailing_metadata =
@@ -301,26 +302,26 @@ static void on_p2s_status(void *arg, int success) {
op.data.send_status_from_server.status_details = &pc->p2s_status_details;
refpc(pc, "on_c2p_sent_status");
err = grpc_call_start_batch(pc->c2p, &op, 1,
- new_closure(on_c2p_sent_status, pc), NULL);
+ new_closure(on_c2p_sent_status, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
}
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,
@@ -329,18 +330,19 @@ static void on_new_call(void *arg, int success) {
pc->p2s = grpc_channel_create_call(
proxy->client, pc->c2p, GRPC_PROPAGATE_DEFAULTS, proxy->cq,
proxy->new_call_details.method, &proxy->new_call_details.host,
- proxy->new_call_details.deadline, NULL);
+ proxy->new_call_details.deadline, nullptr);
gpr_ref_init(&pc->refs, 1);
- op.reserved = NULL;
+ op.reserved = nullptr;
op.op = GRPC_OP_RECV_INITIAL_METADATA;
op.flags = 0;
op.data.recv_initial_metadata.recv_initial_metadata =
&pc->p2s_initial_metadata;
refpc(pc, "on_p2s_recv_initial_metadata");
- err = grpc_call_start_batch(
- pc->p2s, &op, 1, new_closure(on_p2s_recv_initial_metadata, pc), NULL);
+ err = grpc_call_start_batch(pc->p2s, &op, 1,
+ new_closure(on_p2s_recv_initial_metadata, pc),
+ nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
op.op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -348,8 +350,9 @@ static void on_new_call(void *arg, int success) {
op.data.send_initial_metadata.count = pc->c2p_initial_metadata.count;
op.data.send_initial_metadata.metadata = pc->c2p_initial_metadata.metadata;
refpc(pc, "on_p2s_sent_initial_metadata");
- err = grpc_call_start_batch(
- pc->p2s, &op, 1, new_closure(on_p2s_sent_initial_metadata, pc), NULL);
+ err = grpc_call_start_batch(pc->p2s, &op, 1,
+ new_closure(on_p2s_sent_initial_metadata, pc),
+ nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
op.op = GRPC_OP_RECV_MESSAGE;
@@ -357,7 +360,7 @@ static void on_new_call(void *arg, int success) {
op.data.recv_message.recv_message = &pc->c2p_msg;
refpc(pc, "on_c2p_recv_msg");
err = grpc_call_start_batch(pc->c2p, &op, 1,
- new_closure(on_c2p_recv_msg, pc), NULL);
+ new_closure(on_c2p_recv_msg, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
op.op = GRPC_OP_RECV_MESSAGE;
@@ -365,7 +368,7 @@ static void on_new_call(void *arg, int success) {
op.data.recv_message.recv_message = &pc->p2s_msg;
refpc(pc, "on_p2s_recv_msg");
err = grpc_call_start_batch(pc->p2s, &op, 1,
- new_closure(on_p2s_recv_msg, pc), NULL);
+ new_closure(on_p2s_recv_msg, pc), nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
op.op = GRPC_OP_RECV_STATUS_ON_CLIENT;
@@ -376,7 +379,7 @@ static void on_new_call(void *arg, int success) {
op.data.recv_status_on_client.status_details = &pc->p2s_status_details;
refpc(pc, "on_p2s_status");
err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_status, pc),
- NULL);
+ nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
op.op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -384,7 +387,7 @@ static void on_new_call(void *arg, int success) {
op.data.recv_close_on_server.cancelled = &pc->c2p_server_cancelled;
refpc(pc, "on_c2p_closed");
err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_closed, pc),
- NULL);
+ nullptr);
GPR_ASSERT(err == GRPC_CALL_OK);
request_call(proxy);
@@ -394,12 +397,12 @@ static void on_new_call(void *arg, int success) {
unrefpc(pc, "init");
} else {
- GPR_ASSERT(proxy->new_call == NULL);
+ GPR_ASSERT(proxy->new_call == nullptr);
}
}
-static void request_call(grpc_end2end_proxy *proxy) {
- proxy->new_call = NULL;
+static void request_call(grpc_end2end_proxy* proxy) {
+ proxy->new_call = nullptr;
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
proxy->server, &proxy->new_call,
&proxy->new_call_details,
@@ -407,12 +410,12 @@ 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);
+ proxy->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), nullptr);
switch (ev.type) {
case GRPC_QUEUE_TIMEOUT:
gpr_log(GPR_ERROR, "Should never reach here");
@@ -420,7 +423,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 +431,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 */