Skip to content

Commit ab39d52

Browse files
authoredApr 12, 2023
Test: Remove redundant member in test fixtures. (envoyproxy#26705)
Remove redundant member in test fixtures. Signed-off-by: Kevin Baichoo <[email protected]>
1 parent d0e8e4d commit ab39d52

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed
 

‎test/integration/integration_test.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ TEST_P(IntegrationTest, PerWorkerStatsAndBalancing) {
142142

143143
// Per-worker listener stats.
144144
auto check_listener_stats = [this](uint64_t cx_active, uint64_t cx_total) {
145-
if (ip_version_ == Network::Address::IpVersion::v4) {
145+
if (version_ == Network::Address::IpVersion::v4) {
146146
test_server_->waitForGaugeEq("listener.127.0.0.1_0.worker_0.downstream_cx_active", cx_active);
147147
test_server_->waitForGaugeEq("listener.127.0.0.1_0.worker_1.downstream_cx_active", cx_active);
148148
test_server_->waitForCounterEq("listener.127.0.0.1_0.worker_0.downstream_cx_total", cx_total);
@@ -212,7 +212,7 @@ TEST_P(IntegrationTest, ConnectionBalanceFactory) {
212212
initialize();
213213

214214
auto check_listener_stats = [this](uint64_t cx_active, uint64_t cx_total) {
215-
if (ip_version_ == Network::Address::IpVersion::v4) {
215+
if (version_ == Network::Address::IpVersion::v4) {
216216
test_server_->waitForGaugeEq("listener.127.0.0.1_0.worker_0.downstream_cx_active", cx_active);
217217
test_server_->waitForGaugeEq("listener.127.0.0.1_0.worker_1.downstream_cx_active", cx_active);
218218
test_server_->waitForCounterEq("listener.127.0.0.1_0.worker_0.downstream_cx_total", cx_total);
@@ -251,7 +251,7 @@ TEST_P(IntegrationTest, AllWorkersAreHandlingLoad) {
251251
initialize();
252252

253253
std::string worker0_stat_name, worker1_stat_name;
254-
if (ip_version_ == Network::Address::IpVersion::v4) {
254+
if (version_ == Network::Address::IpVersion::v4) {
255255
worker0_stat_name = "listener.127.0.0.1_0.worker_0.downstream_cx_total";
256256
worker1_stat_name = "listener.127.0.0.1_0.worker_1.downstream_cx_total";
257257
} else {
@@ -1512,7 +1512,7 @@ TEST_P(IntegrationTest, AbsolutePathUsingHttpsAllowedInternally) {
15121512
TEST_P(IntegrationTest, TestHostWithAddress) {
15131513
useAccessLog("%REQ(Host)%");
15141514
std::string address_string;
1515-
if (ip_version_ == Network::Address::IpVersion::v4) {
1515+
if (version_ == Network::Address::IpVersion::v4) {
15161516
address_string = TestUtility::getIpv4Loopback();
15171517
} else {
15181518
address_string = "[::1]";
@@ -1660,7 +1660,7 @@ TEST_P(IntegrationTest, TestHeadWithExplicitTE) {
16601660

16611661
TEST_P(IntegrationTest, TestBind) {
16621662
std::string address_string;
1663-
if (ip_version_ == Network::Address::IpVersion::v4) {
1663+
if (version_ == Network::Address::IpVersion::v4) {
16641664
address_string = TestUtility::getIpv4Loopback();
16651665
} else {
16661666
address_string = "::1";
@@ -1923,7 +1923,7 @@ INSTANTIATE_TEST_SUITE_P(IpVersionsAndHttp1Parser, UpstreamEndpointIntegrationTe
19231923
TEST_P(UpstreamEndpointIntegrationTest, TestUpstreamEndpointAddress) {
19241924
initialize();
19251925
EXPECT_STREQ(fake_upstreams_[0]->localAddress()->ip()->addressAsString().c_str(),
1926-
Network::Test::getLoopbackAddressString(ip_version_).c_str());
1926+
Network::Test::getLoopbackAddressString(version_).c_str());
19271927
}
19281928

19291929
// Send continuous pipelined requests while not reading responses, to check
@@ -2508,7 +2508,7 @@ TEST_P(IntegrationTest, SetRouteToDelegatingRouteWithClusterOverride) {
25082508
initialize();
25092509

25102510
const std::string ip_port_pair =
2511-
absl::StrCat(Network::Test::getLoopbackAddressUrlString(ip_version_), ":",
2511+
absl::StrCat(Network::Test::getLoopbackAddressUrlString(version_), ":",
25122512
fake_upstreams_[1]->localAddress()->ip()->port());
25132513

25142514
Http::TestRequestHeaderMapImpl request_headers{

‎test/integration/integration_test.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ class IntegrationTest
1313
public:
1414
IntegrationTest()
1515
: HttpIntegrationTest(Http::CodecType::HTTP1, std::get<0>(GetParam())),
16-
ip_version_(std::get<0>(GetParam())), http1_implementation_(std::get<1>(GetParam())) {
16+
http1_implementation_(std::get<1>(GetParam())) {
1717
setupHttp1ImplOverrides(http1_implementation_);
1818
}
1919

2020
protected:
21-
const Network::Address::IpVersion ip_version_;
2221
const Http1ParserImpl http1_implementation_;
2322
};
2423

@@ -34,12 +33,11 @@ class UpstreamEndpointIntegrationTest
3433
Network::Test::getLoopbackAddressString(std::get<0>(GetParam())), 0);
3534
},
3635
std::get<0>(GetParam())),
37-
ip_version_(std::get<0>(GetParam())), http1_implementation_(std::get<1>(GetParam())) {
36+
http1_implementation_(std::get<1>(GetParam())) {
3837
setupHttp1ImplOverrides(http1_implementation_);
3938
}
4039

4140
protected:
42-
const Network::Address::IpVersion ip_version_;
4341
const Http1ParserImpl http1_implementation_;
4442
};
4543
} // namespace Envoy

0 commit comments

Comments
 (0)
Please sign in to comment.