aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/end2end')
-rw-r--r--test/core/end2end/cq_verifier.h8
-rw-r--r--test/core/end2end/data/client_certs.cc8
-rw-r--r--test/core/end2end/data/server1_cert.cc2
-rw-r--r--test/core/end2end/data/server1_key.cc2
-rw-r--r--test/core/end2end/data/ssl_test_data.h8
-rw-r--r--test/core/end2end/data/test_root_cert.cc2
-rw-r--r--test/core/end2end/end2end_tests.h8
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.cc4
-rw-r--r--test/core/end2end/tests/no_logging.cc2
-rw-r--r--test/core/end2end/tests/simple_request.cc12
10 files changed, 22 insertions, 34 deletions
diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h
index 0b3b3fb349..959f849cb1 100644
--- a/test/core/end2end/cq_verifier.h
+++ b/test/core/end2end/cq_verifier.h
@@ -24,10 +24,6 @@
#include <grpc/grpc.h>
#include "test/core/util/test_config.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* A cq_verifier can verify that expected events arrive in a timely fashion
on a single completion queue */
@@ -63,8 +59,4 @@ int contains_metadata(grpc_metadata_array* array, const char* key,
int contains_metadata_slices(grpc_metadata_array* array, grpc_slice key,
grpc_slice value);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */
diff --git a/test/core/end2end/data/client_certs.cc b/test/core/end2end/data/client_certs.cc
index 7e0b10da5c..46fc13927c 100644
--- a/test/core/end2end/data/client_certs.cc
+++ b/test/core/end2end/data/client_certs.cc
@@ -16,7 +16,7 @@
*
*/
-extern "C" const char test_self_signed_client_cert[] = {
+extern const char test_self_signed_client_cert[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6f, 0x44, 0x43, 0x43,
@@ -100,7 +100,7 @@ extern "C" const char test_self_signed_client_cert[] = {
0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
0x0a, 0x00};
-extern "C" const char test_self_signed_client_key[] = {
+extern const char test_self_signed_client_key[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x64, 0x77, 0x49, 0x42,
@@ -179,7 +179,7 @@ extern "C" const char test_self_signed_client_key[] = {
0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x00};
-extern "C" const char test_signed_client_cert[] = {
+extern const char test_signed_client_cert[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x48, 0x7a, 0x43, 0x43,
@@ -248,7 +248,7 @@ extern "C" const char test_signed_client_cert[] = {
0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45,
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
-extern "C" const char test_signed_client_key[] = {
+extern const char test_signed_client_key[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x65, 0x51, 0x49, 0x42,
diff --git a/test/core/end2end/data/server1_cert.cc b/test/core/end2end/data/server1_cert.cc
index dd09810732..0943244ecc 100644
--- a/test/core/end2end/data/server1_cert.cc
+++ b/test/core/end2end/data/server1_cert.cc
@@ -16,7 +16,7 @@
*
*/
-extern "C" const char test_server1_cert[] = {
+extern const char test_server1_cert[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6e, 0x44, 0x43, 0x43,
diff --git a/test/core/end2end/data/server1_key.cc b/test/core/end2end/data/server1_key.cc
index 59dcaf6334..8f3ad15c26 100644
--- a/test/core/end2end/data/server1_key.cc
+++ b/test/core/end2end/data/server1_key.cc
@@ -16,7 +16,7 @@
*
*/
-extern "C" const char test_server1_key[] = {
+extern const char test_server1_key[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43,
diff --git a/test/core/end2end/data/ssl_test_data.h b/test/core/end2end/data/ssl_test_data.h
index e9c7dbceb2..303f3a6eda 100644
--- a/test/core/end2end/data/ssl_test_data.h
+++ b/test/core/end2end/data/ssl_test_data.h
@@ -19,10 +19,6 @@
#ifndef GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H
#define GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
extern const char test_root_cert[];
extern const char test_server1_cert[];
extern const char test_server1_key[];
@@ -31,8 +27,4 @@ extern const char test_self_signed_client_key[];
extern const char test_signed_client_cert[];
extern const char test_signed_client_key[];
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H */
diff --git a/test/core/end2end/data/test_root_cert.cc b/test/core/end2end/data/test_root_cert.cc
index 36fca2e45f..b4771b2cb8 100644
--- a/test/core/end2end/data/test_root_cert.cc
+++ b/test/core/end2end/data/test_root_cert.cc
@@ -16,7 +16,7 @@
*
*/
-extern "C" const char test_root_cert[] = {
+extern const char test_root_cert[] = {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x7a, 0x43, 0x43,
diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h
index 33943a7271..b42d90b55c 100644
--- a/test/core/end2end/end2end_tests.h
+++ b/test/core/end2end/end2end_tests.h
@@ -21,10 +21,6 @@
#include <grpc/grpc.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef struct grpc_end2end_test_fixture grpc_end2end_test_fixture;
typedef struct grpc_end2end_test_config grpc_end2end_test_config;
@@ -78,8 +74,4 @@ const grpc_slice* get_host_override_slice(const char* str,
void validate_host_override_string(const char* pattern, grpc_slice str,
grpc_end2end_test_config config);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc
index d84f8a31fa..75117218e4 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.cc
+++ b/test/core/end2end/fuzzers/api_fuzzer.cc
@@ -56,7 +56,7 @@ static grpc_server* g_server;
static grpc_channel* g_channel;
static grpc_resource_quota* g_resource_quota;
-extern "C" gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
+extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
static gpr_timespec now_impl(gpr_clock_type clock_type) {
GPR_ASSERT(clock_type != GPR_TIMESPAN);
@@ -441,7 +441,7 @@ grpc_ares_request* my_dns_lookup_ares(
// client connection
// defined in tcp_client_posix.c
-extern "C" void (*grpc_tcp_client_connect_impl)(
+extern void (*grpc_tcp_client_connect_impl)(
grpc_exec_ctx* exec_ctx, grpc_closure* closure, grpc_endpoint** ep,
grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
const grpc_resolved_address* addr, grpc_millis deadline);
diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc
index 55d211c44a..bf8651221a 100644
--- a/test/core/end2end/tests/no_logging.cc
+++ b/test/core/end2end/tests/no_logging.cc
@@ -36,7 +36,7 @@ enum { TIMEOUT = 200000 };
static void* tag(intptr_t t) { return (void*)t; }
-extern "C" void gpr_default_log(gpr_log_func_args* args);
+void gpr_default_log(gpr_log_func_args* args);
static void test_no_log(gpr_log_func_args* args) {
char* message = nullptr;
diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc
index ec7425aa09..7eb7467981 100644
--- a/test/core/end2end/tests/simple_request.cc
+++ b/test/core/end2end/tests/simple_request.cc
@@ -99,6 +99,7 @@ static void simple_request_body(grpc_end2end_test_config config,
grpc_metadata_array request_metadata_recv;
grpc_call_details call_details;
grpc_status_code status;
+ const char* error_string;
grpc_call_error error;
grpc_slice details;
int was_cancelled = 2;
@@ -148,6 +149,7 @@ static void simple_request_body(grpc_end2end_test_config config,
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
+ op->data.recv_status_on_client.error_string = &error_string;
op->flags = 0;
op->reserved = nullptr;
op++;
@@ -199,6 +201,15 @@ static void simple_request_body(grpc_end2end_test_config config,
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+ // the following sanity check makes sure that the requested error string is
+ // correctly populated by the core. It looks for certain substrings that are
+ // not likely to change much. Some parts of the error, like time created,
+ // obviously are not checked.
+ GPR_ASSERT(nullptr != strstr(error_string, "xyz"));
+ GPR_ASSERT(nullptr != strstr(error_string, "description"));
+ GPR_ASSERT(nullptr != strstr(error_string, "Error received from peer"));
+ GPR_ASSERT(nullptr != strstr(error_string, "grpc_message"));
+ GPR_ASSERT(nullptr != strstr(error_string, "grpc_status"));
GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
validate_host_override_string("foo.test.google.fr:1234", call_details.host,
config);
@@ -206,6 +217,7 @@ static void simple_request_body(grpc_end2end_test_config config,
GPR_ASSERT(was_cancelled == 1);
grpc_slice_unref(details);
+ gpr_free((void*)error_string);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);