Deal with issues surrounding const members of classes used in

containers
pull/6863/head
Vijay Pai 9 years ago
parent a63271c77f
commit 679c75f0a6
  1. 11
      test/cpp/end2end/async_end2end_test.cc
  2. 9
      test/cpp/end2end/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);
}
}
}

@ -199,7 +199,10 @@ class TestScenario {
credentials_type.c_str());
}
bool use_proxy;
const grpc::string credentials_type;
// 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)
// manage vector insertion using a copy constructor
grpc::string credentials_type;
};
class End2endTest : public ::testing::TestWithParam<TestScenario> {
@ -1421,9 +1424,9 @@ std::vector<TestScenario> CreateTestScenarios(bool use_proxy,
}
for (auto it = credentials_types.begin(); it != credentials_types.end();
++it) {
scenarios.push_back(TestScenario(false, *it));
scenarios.emplace_back(false, *it);
if (use_proxy) {
scenarios.push_back(TestScenario(true, *it));
scenarios.emplace_back(true, *it);
}
}
return scenarios;

Loading…
Cancel
Save