aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end/async_end2end_test.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-06-15 13:08:00 -0700
committerGravatar Vijay Pai <vpai@google.com>2016-06-15 13:10:32 -0700
commit679c75f0a67d65f115bb44521f49da3db14c2ad2 (patch)
tree0ae450f6d22023f5be6d1b73c02092680c2af712 /test/cpp/end2end/async_end2end_test.cc
parenta63271c77f7ee4802761535f8c844f789328ad9f (diff)
Deal with issues surrounding const members of classes used in
containers
Diffstat (limited to 'test/cpp/end2end/async_end2end_test.cc')
-rw-r--r--test/cpp/end2end/async_end2end_test.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 2e0c9da107..029bdc8bce 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -233,8 +233,11 @@ class TestScenario {
disable_blocking, credentials_type.c_str(), message_content.size());
}
bool disable_blocking;
- const grpc::string credentials_type;
- const grpc::string message_content;
+ // 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)
+ // manage vector insertion using a copy constructor
+ grpc::string credentials_type;
+ grpc::string message_content;
};
class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> {
@@ -1395,9 +1398,9 @@ std::vector<TestScenario> CreateTestScenarios(bool test_disable_blocking,
for (auto cred = credentials_types.begin(); cred != credentials_types.end();
++cred) {
for (auto msg = messages.begin(); msg != messages.end(); msg++) {
- scenarios.push_back(TestScenario(false, *cred, *msg));
+ scenarios.emplace_back(false, *cred, *msg);
if (test_disable_blocking) {
- scenarios.push_back(TestScenario(true, *cred, *msg));
+ scenarios.emplace_back(true, *cred, *msg);
}
}
}