Assert where host fields are different.
| 27 | |
| 28 | // Assert where host fields are different. |
| 29 | TEST(NetworkUtil, NetAddrCompHostnameDiff) { |
| 30 | TNetworkAddressComparator fixture; |
| 31 | TNetworkAddress first; |
| 32 | TNetworkAddress second; |
| 33 | |
| 34 | first.__set_hostname("aaaa"); |
| 35 | first.__set_uds_address("uds"); |
| 36 | first.__set_port(0); |
| 37 | |
| 38 | second.__set_hostname("bbbb"); |
| 39 | second.__set_uds_address("uds"); |
| 40 | second.__set_port(0); |
| 41 | |
| 42 | ASSERT_TRUE(fixture(first, second)); |
| 43 | ASSERT_FALSE(fixture(second, first)); |
| 44 | ASSERT_TRUE( |
| 45 | CompareNetworkAddressPB(FromTNetworkAddress(first), FromTNetworkAddress(second)) |
| 46 | < 0); |
| 47 | ASSERT_TRUE( |
| 48 | CompareNetworkAddressPB(FromTNetworkAddress(second), FromTNetworkAddress(first)) |
| 49 | > 0); |
| 50 | } |
| 51 | |
| 52 | // Assert where host fields are equal but port is different. |
| 53 | TEST(NetworkUtil, NetAddrCompPortDiff) { |
nothing calls this directly
no test coverage detected