aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/util')
-rw-r--r--test/core/util/BUILD30
-rw-r--r--test/core/util/debugger_macros.cc2
-rw-r--r--test/core/util/debugger_macros.h8
-rw-r--r--test/core/util/grpc_profiler.cc (renamed from test/core/util/grpc_profiler.c)0
-rw-r--r--test/core/util/grpc_profiler.h8
-rw-r--r--test/core/util/memory_counters.cc (renamed from test/core/util/memory_counters.c)0
-rw-r--r--test/core/util/mock_endpoint.cc (renamed from test/core/util/mock_endpoint.c)0
-rw-r--r--test/core/util/one_corpus_entry_fuzzer.cc (renamed from test/core/util/one_corpus_entry_fuzzer.c)2
-rw-r--r--test/core/util/parse_hexstring.cc (renamed from test/core/util/parse_hexstring.c)0
-rw-r--r--test/core/util/passthru_endpoint.cc (renamed from test/core/util/passthru_endpoint.c)0
-rw-r--r--test/core/util/port.cc (renamed from test/core/util/port.c)0
-rw-r--r--test/core/util/port_server_client.cc (renamed from test/core/util/port_server_client.c)10
-rw-r--r--test/core/util/reconnect_server.cc (renamed from test/core/util/reconnect_server.c)2
-rw-r--r--test/core/util/reconnect_server.h8
-rw-r--r--test/core/util/slice_splitter.cc (renamed from test/core/util/slice_splitter.c)0
-rw-r--r--test/core/util/test_config.cc (renamed from test/core/util/test_config.c)2
-rw-r--r--test/core/util/test_config.h4
-rw-r--r--test/core/util/test_tcp_server.cc (renamed from test/core/util/test_tcp_server.c)6
-rw-r--r--test/core/util/trickle_endpoint.cc (renamed from test/core/util/trickle_endpoint.c)0
-rw-r--r--test/core/util/trickle_endpoint.h8
20 files changed, 29 insertions, 61 deletions
diff --git a/test/core/util/BUILD b/test/core/util/BUILD
index 5844a17728..bc6fe9dd64 100644
--- a/test/core/util/BUILD
+++ b/test/core/util/BUILD
@@ -21,8 +21,8 @@ grpc_package(name = "test/core/util", visibility = "public")
grpc_cc_library(
name = "gpr_test_util",
srcs = [
- "memory_counters.c",
- "test_config.c",
+ "memory_counters.cc",
+ "test_config.cc",
],
hdrs = [
"memory_counters.h",
@@ -48,16 +48,16 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_test_util_base",
srcs = [
- "grpc_profiler.c",
- "mock_endpoint.c",
- "parse_hexstring.c",
- "passthru_endpoint.c",
- "port.c",
- "port_server_client.c",
- "reconnect_server.c",
- "slice_splitter.c",
- "test_tcp_server.c",
- "trickle_endpoint.c",
+ "grpc_profiler.cc",
+ "mock_endpoint.cc",
+ "parse_hexstring.cc",
+ "passthru_endpoint.cc",
+ "port.cc",
+ "port_server_client.cc",
+ "reconnect_server.cc",
+ "slice_splitter.cc",
+ "test_tcp_server.cc",
+ "trickle_endpoint.cc",
],
hdrs = [
"grpc_profiler.h",
@@ -71,7 +71,7 @@ grpc_cc_library(
"test_tcp_server.h",
"trickle_endpoint.h",
],
- language = "C",
+ language = "C++",
deps = [
":gpr_test_util",
"//:grpc_common",
@@ -83,7 +83,7 @@ grpc_cc_library(
name = "grpc_test_util",
srcs = [],
hdrs = [],
- language = "C",
+ language = "C++",
deps = [
":grpc_test_util_base",
"//:grpc",
@@ -94,7 +94,7 @@ grpc_cc_library(
name = "grpc_test_util_unsecure",
srcs = [],
hdrs = [],
- language = "C",
+ language = "C++",
deps = [
":grpc_test_util_base",
"//:grpc_unsecure",
diff --git a/test/core/util/debugger_macros.cc b/test/core/util/debugger_macros.cc
index 5985fcfb83..d344c3fb74 100644
--- a/test/core/util/debugger_macros.cc
+++ b/test/core/util/debugger_macros.cc
@@ -29,7 +29,7 @@
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/surface/call.h"
-extern "C" void grpc_summon_debugger_macros() {}
+void grpc_summon_debugger_macros() {}
grpc_stream* grpc_transport_stream_from_call(grpc_call* call) {
grpc_call_stack* cs = grpc_call_get_call_stack(call);
diff --git a/test/core/util/debugger_macros.h b/test/core/util/debugger_macros.h
index 24718d9307..c6b3720c5a 100644
--- a/test/core/util/debugger_macros.h
+++ b/test/core/util/debugger_macros.h
@@ -19,14 +19,6 @@
#ifndef GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H
#define GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
void grpc_summon_debugger_macros();
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
#endif /* GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H */
diff --git a/test/core/util/grpc_profiler.c b/test/core/util/grpc_profiler.cc
index 88f233598b..88f233598b 100644
--- a/test/core/util/grpc_profiler.c
+++ b/test/core/util/grpc_profiler.cc
diff --git a/test/core/util/grpc_profiler.h b/test/core/util/grpc_profiler.h
index 0c35822f88..f9ddd2242e 100644
--- a/test/core/util/grpc_profiler.h
+++ b/test/core/util/grpc_profiler.h
@@ -19,15 +19,7 @@
#ifndef GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H
#define GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
void grpc_profiler_start(const char* filename);
void grpc_profiler_stop();
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
#endif /* GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H */
diff --git a/test/core/util/memory_counters.c b/test/core/util/memory_counters.cc
index ff85a63803..ff85a63803 100644
--- a/test/core/util/memory_counters.c
+++ b/test/core/util/memory_counters.cc
diff --git a/test/core/util/mock_endpoint.c b/test/core/util/mock_endpoint.cc
index a467dcdc18..a467dcdc18 100644
--- a/test/core/util/mock_endpoint.c
+++ b/test/core/util/mock_endpoint.cc
diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.cc
index cfd5a1099f..c0b67da1e2 100644
--- a/test/core/util/one_corpus_entry_fuzzer.c
+++ b/test/core/util/one_corpus_entry_fuzzer.cc
@@ -21,7 +21,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/load_file.h"
-extern int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
extern bool squelch;
extern bool leak_check;
diff --git a/test/core/util/parse_hexstring.c b/test/core/util/parse_hexstring.cc
index 6dee0f163a..6dee0f163a 100644
--- a/test/core/util/parse_hexstring.c
+++ b/test/core/util/parse_hexstring.cc
diff --git a/test/core/util/passthru_endpoint.c b/test/core/util/passthru_endpoint.cc
index acce902010..acce902010 100644
--- a/test/core/util/passthru_endpoint.c
+++ b/test/core/util/passthru_endpoint.cc
diff --git a/test/core/util/port.c b/test/core/util/port.cc
index c5bebe08e7..c5bebe08e7 100644
--- a/test/core/util/port.c
+++ b/test/core/util/port.cc
diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.cc
index 988a5384b9..927bc91d38 100644
--- a/test/core/util/port_server_client.c
+++ b/test/core/util/port_server_client.cc
@@ -80,7 +80,7 @@ void grpc_free_port_using_server(int port) {
shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
grpc_schedule_on_exec_ctx);
- req.host = GRPC_PORT_SERVER_ADDRESS;
+ req.host = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
gpr_asprintf(&path, "/drop/%d", port);
req.http.path = path;
@@ -167,7 +167,7 @@ static void got_port_from_server(grpc_exec_ctx* exec_ctx, void* arg,
GPR_TIMESPAN)));
pr->retries++;
req.host = pr->server;
- req.http.path = "/get";
+ req.http.path = const_cast<char*>("/get");
grpc_http_response_destroy(&pr->response);
memset(&pr->response, 0, sizeof(pr->response));
grpc_resource_quota* resource_quota =
@@ -213,11 +213,11 @@ int grpc_pick_port_using_server(void) {
shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
grpc_schedule_on_exec_ctx);
pr.port = -1;
- pr.server = GRPC_PORT_SERVER_ADDRESS;
+ pr.server = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
pr.ctx = &context;
- req.host = GRPC_PORT_SERVER_ADDRESS;
- req.http.path = "/get";
+ req.host = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
+ req.http.path = const_cast<char*>("/get");
grpc_httpcli_context_init(&context);
grpc_resource_quota* resource_quota =
diff --git a/test/core/util/reconnect_server.c b/test/core/util/reconnect_server.cc
index 742bcf560e..c7c0595d7f 100644
--- a/test/core/util/reconnect_server.c
+++ b/test/core/util/reconnect_server.cc
@@ -82,7 +82,7 @@ static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
gpr_free(peer);
}
}
- new_tail = gpr_malloc(sizeof(timestamp_list));
+ new_tail = static_cast<timestamp_list*>(gpr_malloc(sizeof(timestamp_list)));
new_tail->timestamp = now;
new_tail->next = NULL;
if (server->tail == NULL) {
diff --git a/test/core/util/reconnect_server.h b/test/core/util/reconnect_server.h
index 5aec586ff6..d15abe529d 100644
--- a/test/core/util/reconnect_server.h
+++ b/test/core/util/reconnect_server.h
@@ -23,10 +23,6 @@
#include <grpc/support/time.h>
#include "test/core/util/test_tcp_server.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef struct timestamp_list {
gpr_timespec timestamp;
struct timestamp_list* next;
@@ -46,8 +42,4 @@ void reconnect_server_poll(reconnect_server* server, int seconds);
void reconnect_server_destroy(reconnect_server* server);
void reconnect_server_clear_timestamps(reconnect_server* server);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H */
diff --git a/test/core/util/slice_splitter.c b/test/core/util/slice_splitter.cc
index e25e1d862a..e25e1d862a 100644
--- a/test/core/util/slice_splitter.c
+++ b/test/core/util/slice_splitter.cc
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.cc
index ea3a4b5ca0..3106fb01ea 100644
--- a/test/core/util/test_config.c
+++ b/test/core/util/test_config.cc
@@ -176,7 +176,7 @@ static LONG crash_handler(struct _EXCEPTION_POINTERS* ex_info) {
static void abort_handler(int sig) {
fprintf(stderr, "Abort handler called.\n");
- print_current_stack(NULL);
+ print_current_stack();
if (IsDebuggerPresent()) {
__debugbreak();
} else {
diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h
index edc0fbad7c..4383fbfce8 100644
--- a/test/core/util/test_config.h
+++ b/test/core/util/test_config.h
@@ -23,7 +23,7 @@
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif
extern int64_t g_fixture_slowdown_factor;
extern int64_t g_poller_slowdown_factor;
@@ -45,6 +45,6 @@ void grpc_test_init(int argc, char** argv);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
+#endif
#endif /* GRPC_TEST_CORE_UTIL_TEST_CONFIG_H */
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.cc
index d97f2c7bda..925209d255 100644
--- a/test/core/util/test_tcp_server.c
+++ b/test/core/util/test_tcp_server.cc
@@ -35,7 +35,7 @@
static void on_server_destroyed(grpc_exec_ctx* exec_ctx, void* data,
grpc_error* error) {
- test_tcp_server* server = data;
+ test_tcp_server* server = static_cast<test_tcp_server*>(data);
server->shutdown = 1;
}
@@ -46,7 +46,7 @@ void test_tcp_server_init(test_tcp_server* server,
GRPC_CLOSURE_INIT(&server->shutdown_complete, on_server_destroyed, server,
grpc_schedule_on_exec_ctx);
server->shutdown = 0;
- server->pollset = gpr_zalloc(grpc_pollset_size());
+ server->pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
grpc_pollset_init(server->pollset, &server->mu);
server->on_connect = on_connect;
server->cb_data = user_data;
@@ -93,7 +93,7 @@ void test_tcp_server_poll(test_tcp_server* server, int seconds) {
static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
static void finish_pollset(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error* error) {
- grpc_pollset_destroy(exec_ctx, arg);
+ grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(arg));
}
void test_tcp_server_destroy(test_tcp_server* server) {
diff --git a/test/core/util/trickle_endpoint.c b/test/core/util/trickle_endpoint.cc
index c8b54b481d..c8b54b481d 100644
--- a/test/core/util/trickle_endpoint.c
+++ b/test/core/util/trickle_endpoint.cc
diff --git a/test/core/util/trickle_endpoint.h b/test/core/util/trickle_endpoint.h
index de87a1f4ab..11c113bda8 100644
--- a/test/core/util/trickle_endpoint.h
+++ b/test/core/util/trickle_endpoint.h
@@ -21,10 +21,6 @@
#include "src/core/lib/iomgr/endpoint.h"
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
grpc_endpoint* grpc_trickle_endpoint_create(grpc_endpoint* wrap,
double bytes_per_second);
@@ -34,8 +30,4 @@ size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx* exec_ctx,
size_t grpc_trickle_get_backlog(grpc_endpoint* endpoint);
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
#endif