diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-10-23 15:33:21 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-10-25 16:23:01 -0700 |
commit | 34a57d0346afe95e11104462c30dc468b0cb0b89 (patch) | |
tree | 67db15f7b8b361e0618199dc55215f3b4d626201 /test/core/fling | |
parent | c563b583cb9b7fecc33971581368796d2df4759d (diff) |
rename all test core files to cc and a lot of C++ style conversions
Diffstat (limited to 'test/core/fling')
-rw-r--r-- | test/core/fling/client.cc (renamed from test/core/fling/client.c) | 4 | ||||
-rw-r--r-- | test/core/fling/fling_stream_test.cc (renamed from test/core/fling/fling_stream_test.c) | 10 | ||||
-rw-r--r-- | test/core/fling/fling_test.cc (renamed from test/core/fling/fling_test.c) | 16 | ||||
-rw-r--r-- | test/core/fling/server.cc (renamed from test/core/fling/server.c) | 4 |
4 files changed, 17 insertions, 17 deletions
diff --git a/test/core/fling/client.c b/test/core/fling/client.cc index be7bfc2280..356ec4bb28 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.cc @@ -151,10 +151,10 @@ int main(int argc, char **argv) { int payload_size = 1; int secure = 0; - char *target = "localhost:443"; + const char *target = "localhost:443"; gpr_cmdline *cl; grpc_event event; - char *scenario_name = "ping-pong-request"; + const char *scenario_name = "ping-pong-request"; scenario sc = {NULL, NULL, NULL}; gpr_timers_set_log_filename("latency_trace.fling_client.txt"); diff --git a/test/core/fling/fling_stream_test.c b/test/core/fling/fling_stream_test.cc index 566d9ae6f0..4e3b63e192 100644 --- a/test/core/fling/fling_stream_test.c +++ b/test/core/fling/fling_stream_test.cc @@ -44,9 +44,9 @@ int main(int argc, char **argv) { /* start the server */ gpr_asprintf(&args[0], "%s/fling_server%s", root, gpr_subprocess_binary_extension()); - args[1] = "--bind"; + args[1] = const_cast<char *>("--bind"); gpr_join_host_port(&args[2], "::", port); - args[3] = "--no-secure"; + args[3] = const_cast<char *>("--no-secure"); svr = gpr_subprocess_create(4, (const char **)args); gpr_free(args[0]); gpr_free(args[2]); @@ -54,10 +54,10 @@ int main(int argc, char **argv) { /* start the client */ gpr_asprintf(&args[0], "%s/fling_client%s", root, gpr_subprocess_binary_extension()); - args[1] = "--target"; + args[1] = const_cast<char *>("--target"); gpr_join_host_port(&args[2], "127.0.0.1", port); - args[3] = "--scenario=ping-pong-stream"; - args[4] = "--no-secure"; + args[3] = const_cast<char *>("--scenario=ping-pong-stream"); + args[4] = const_cast<char *>("--no-secure"); args[5] = 0; cli = gpr_subprocess_create(6, (const char **)args); gpr_free(args[0]); diff --git a/test/core/fling/fling_test.c b/test/core/fling/fling_test.cc index 90b48e7737..a7681d572a 100644 --- a/test/core/fling/fling_test.c +++ b/test/core/fling/fling_test.cc @@ -26,9 +26,9 @@ #include "src/core/lib/support/string.h" #include "test/core/util/port.h" -int main(int argc, char **argv) { - char *me = argv[0]; - char *lslash = strrchr(me, '/'); +int main(int argc, const char **argv) { + const char *me = argv[0]; + const char *lslash = strrchr(me, '/'); char root[1024]; int port = grpc_pick_unused_port_or_die(); char *args[10]; @@ -44,9 +44,9 @@ int main(int argc, char **argv) { /* start the server */ gpr_asprintf(&args[0], "%s/fling_server%s", root, gpr_subprocess_binary_extension()); - args[1] = "--bind"; + args[1] = const_cast<char *>("--bind"); gpr_join_host_port(&args[2], "::", port); - args[3] = "--no-secure"; + args[3] = const_cast<char *>("--no-secure"); svr = gpr_subprocess_create(4, (const char **)args); gpr_free(args[0]); gpr_free(args[2]); @@ -54,10 +54,10 @@ int main(int argc, char **argv) { /* start the client */ gpr_asprintf(&args[0], "%s/fling_client%s", root, gpr_subprocess_binary_extension()); - args[1] = "--target"; + args[1] = const_cast<char *>("--target"); gpr_join_host_port(&args[2], "127.0.0.1", port); - args[3] = "--scenario=ping-pong-request"; - args[4] = "--no-secure"; + args[3] = const_cast<char *>("--scenario=ping-pong-request"); + args[4] = const_cast<char *>("--no-secure"); args[5] = 0; cli = gpr_subprocess_create(6, (const char **)args); gpr_free(args[0]); diff --git a/test/core/fling/server.c b/test/core/fling/server.cc index b3a7fa21ec..34e5f79f0b 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.cc @@ -177,7 +177,7 @@ int main(int argc, char **argv) { int shutdown_finished = 0; int secure = 0; - char *addr = NULL; + const char *addr = NULL; char *fake_argv[1]; @@ -247,7 +247,7 @@ int main(int argc, char **argv) { cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); - s = ev.tag; + s = static_cast<call_state *>(ev.tag); switch (ev.type) { case GRPC_OP_COMPLETE: switch ((intptr_t)s) { |