aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-08-05 07:16:52 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-08-05 07:16:52 -0700
commit220adcc745a9c60cf3bab00f020b2fce8c3b7c9d (patch)
treebda6eaefe3f88a5777d7699ed12690b27ff06760 /test/cpp/end2end
parente871ef4ef753c813306176bc2c792639372c28a1 (diff)
parent6fa0b982066ac854f2573473a5ecc001c2f4a22d (diff)
Merge branch 'primary-goat-whisperer' into the-test-be-sleepy
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r--test/cpp/end2end/generic_end2end_test.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc
index 4951c82b9a..b53c32144b 100644
--- a/test/cpp/end2end/generic_end2end_test.cc
+++ b/test/cpp/end2end/generic_end2end_test.cc
@@ -100,11 +100,11 @@ std::unique_ptr<ByteBuffer> SerializeToByteBuffer(
class GenericEnd2endTest : public ::testing::Test {
protected:
- GenericEnd2endTest() : generic_service_("*") {}
+ GenericEnd2endTest() : generic_service_("*"), server_host_("localhost") {}
void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die();
- server_address_ << "localhost:" << port;
+ server_address_ << server_host_ << ":" << port;
// Setup server
ServerBuilder builder;
builder.AddListeningPort(server_address_.str(), InsecureServerCredentials());
@@ -165,7 +165,7 @@ class GenericEnd2endTest : public ::testing::Test {
srv_cq_.get(), tag(4));
verify_ok(srv_cq_.get(), 4, true);
- EXPECT_EQ(server_address_.str(), srv_ctx.host());
+ EXPECT_EQ(server_host_, srv_ctx.host());
EXPECT_EQ(kMethodName, srv_ctx.method());
ByteBuffer recv_buffer;
stream.Read(&recv_buffer, tag(5));
@@ -200,6 +200,7 @@ class GenericEnd2endTest : public ::testing::Test {
std::unique_ptr<grpc::GenericStub> generic_stub_;
std::unique_ptr<Server> server_;
AsyncGenericService generic_service_;
+ const grpc::string server_host_;
std::ostringstream server_address_;
};
@@ -237,7 +238,7 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) {
srv_cq_.get(), tag(2));
verify_ok(srv_cq_.get(), 2, true);
- EXPECT_EQ(server_address_.str(), srv_ctx.host());
+ EXPECT_EQ(server_host_, srv_ctx.host());
EXPECT_EQ(kMethodName, srv_ctx.method());
std::unique_ptr<ByteBuffer> send_buffer =