MCPcopy Create free account
hub / github.com/apache/impala / CheckTranslation

Function CheckTranslation

be/src/util/network-util-test.cc:171–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void CheckTranslation(const TNetworkAddress& thrift_address) {
172 NetworkAddressPB proto_address = FromTNetworkAddress(thrift_address);
173 TNetworkAddress thrift_address2 = FromNetworkAddressPB(proto_address);
174 NetworkAddressPB proto_address2 = FromTNetworkAddress(thrift_address2);
175
176 TNetworkAddressComparator fixture;
177 ASSERT_FALSE(fixture(thrift_address, thrift_address2));
178 ASSERT_FALSE(fixture(thrift_address2, thrift_address));
179 ASSERT_TRUE(CompareNetworkAddressPB(proto_address, proto_address2) == 0);
180 ASSERT_TRUE(CompareNetworkAddressPB(proto_address2, proto_address) == 0);
181}
182
183// Assert consistent translation between TNetworkAddress and NetworkAddressPB.
184TEST(NetworkUtil, NetAddrTranslation) {

Callers 1

TESTFunction · 0.85

Calls 3

FromTNetworkAddressFunction · 0.85
FromNetworkAddressPBFunction · 0.85
CompareNetworkAddressPBFunction · 0.85

Tested by

no test coverage detected