diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/cq_verifier.c | 3 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_ssl_cert.c | 4 | ||||
-rw-r--r-- | test/core/end2end/fuzzers/api_fuzzer.c | 2 | ||||
-rw-r--r-- | test/core/slice/percent_encoding_test.c | 4 | ||||
-rw-r--r-- | test/cpp/end2end/async_end2end_test.cc | 21 | ||||
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 20 | ||||
-rw-r--r-- | test/cpp/grpclb/grpclb_test.cc | 5 |
7 files changed, 38 insertions, 21 deletions
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 3b463a6933..bc2d5888f0 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -109,8 +109,7 @@ static int has_metadata_slices(const grpc_metadata *md, size_t count, grpc_slice key, grpc_slice value) { size_t i; for (i = 0; i < count; i++) { - if (grpc_slice_eq(md[i].key, key) && - grpc_slice_eq(md[i].value, value)) { + if (grpc_slice_eq(md[i].key, key) && grpc_slice_eq(md[i].value, value)) { return 1; } } diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index 92fac10d49..844e93396d 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -323,8 +323,8 @@ static void simple_request_body(grpc_end2end_test_fixture f, grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr:1234"); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, - grpc_slice_from_static_string("/foo"), &host, deadline, - NULL); + grpc_slice_from_static_string("/foo"), &host, + deadline, NULL); GPR_ASSERT(c); memset(ops, 0, sizeof(ops)); diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index c9d5c24798..070a6039c4 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -108,7 +108,7 @@ static char *read_string(input_stream *inp, bool *special) { *special = (c == 1); } if (c == 1) { - str[sz-1] = 0; + str[sz - 1] = 0; } return str; } diff --git a/test/core/slice/percent_encoding_test.c b/test/core/slice/percent_encoding_test.c index 0bff4903e6..222e695fd4 100644 --- a/test/core/slice/percent_encoding_test.c +++ b/test/core/slice/percent_encoding_test.c @@ -123,8 +123,8 @@ static void test_nonconformant_vector(const char *encoded, encoded2raw_permissive_msg); gpr_free(encoded2raw_permissive_msg); - GPR_ASSERT(grpc_slice_eq(permissive_unencoded_slice, - encoded2raw_permissive_slice)); + GPR_ASSERT( + grpc_slice_eq(permissive_unencoded_slice, encoded2raw_permissive_slice)); grpc_slice_unref(permissive_unencoded_slice); grpc_slice_unref(encoded2raw_permissive_slice); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 8e385d100c..70be857b49 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -228,12 +228,7 @@ class TestScenario { : disable_blocking(non_block), credentials_type(creds_type), message_content(content) {} - void Log() const { - gpr_log( - GPR_INFO, - "Scenario: disable_blocking %d, credentials %s, message size %" PRIuPTR, - disable_blocking, credentials_type.c_str(), message_content.size()); - } + void Log() const; bool disable_blocking; // Although the below grpc::string's are logically const, we can't declare // them const because of a limitation in the way old compilers (e.g., gcc-4.4) @@ -242,6 +237,20 @@ class TestScenario { grpc::string message_content; }; +static std::ostream& operator<<(std::ostream& out, + const TestScenario& scenario) { + return out << "TestScenario{disable_blocking=" + << (scenario.disable_blocking ? "true" : "false") + << ", credentials='" << scenario.credentials_type + << "', message_size=" << scenario.message_content.size() << "}"; +} + +void TestScenario::Log() const { + std::ostringstream out; + out << *this; + gpr_log(GPR_DEBUG, "%s", out.str().c_str()); +} + class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> { protected: AsyncEnd2endTest() { GetParam().Log(); } diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 9bb892c694..620b3ae7bc 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -209,10 +209,7 @@ class TestScenario { public: TestScenario(bool proxy, const grpc::string& creds_type) : use_proxy(proxy), credentials_type(creds_type) {} - void Log() const { - gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, - credentials_type.c_str()); - } + void Log() const; bool use_proxy; // Although the below grpc::string is logically const, we can't declare // them const because of a limitation in the way old compilers (e.g., gcc-4.4) @@ -220,6 +217,19 @@ class TestScenario { grpc::string credentials_type; }; +static std::ostream& operator<<(std::ostream& out, + const TestScenario& scenario) { + return out << "TestScenario{use_proxy=" + << (scenario.use_proxy ? "true" : "false") << ", credentials='" + << scenario.credentials_type << "'}"; +} + +void TestScenario::Log() const { + std::ostringstream out; + out << *this; + gpr_log(GPR_DEBUG, "%s", out.str().c_str()); +} + class End2endTest : public ::testing::TestWithParam<TestScenario> { protected: End2endTest() @@ -635,7 +645,7 @@ TEST_P(End2endServerTryCancelTest, BidiStreamServerCancelAfter) { TestBidiStreamServerCancel(CANCEL_AFTER_PROCESSING, 5); } -TEST_P(End2endTest, SimpleRpcWithCustomeUserAgentPrefix) { +TEST_P(End2endTest, SimpleRpcWithCustomUserAgentPrefix) { user_agent_prefix_ = "custom_prefix"; ResetStub(); EchoRequest request; diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index 87b02e5c88..c93dfacbe0 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -346,9 +346,8 @@ static void start_backend_server(server_fixture *sf) { } GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); const string expected_token = - strlen(sf->lb_token_prefix) == 0 - ? "" - : sf->lb_token_prefix + std::to_string(sf->port); + strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix + + std::to_string(sf->port); GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token", expected_token.c_str())); |