aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end/async_end2end_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/end2end/async_end2end_test.cc')
-rw-r--r--test/cpp/end2end/async_end2end_test.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 2ce3f2f7bd..32e8a41795 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -42,6 +42,7 @@
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc/grpc.h>
+#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/tls.h>
@@ -228,12 +229,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 +238,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(); }