diff options
author | 2016-06-15 13:08:00 -0700 | |
---|---|---|
committer | 2016-06-15 13:10:32 -0700 | |
commit | 679c75f0a67d65f115bb44521f49da3db14c2ad2 (patch) | |
tree | 0ae450f6d22023f5be6d1b73c02092680c2af712 /test/cpp/end2end/async_end2end_test.cc | |
parent | a63271c77f7ee4802761535f8c844f789328ad9f (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.cc | 11 |
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); } } } |