diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/ipv6_address/ut/ipv6_address_ut.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/ipv6_address/ut/ipv6_address_ut.cpp')
-rw-r--r-- | library/cpp/ipv6_address/ut/ipv6_address_ut.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp index 377ffd0f65..73bb7cffdd 100644 --- a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp +++ b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/ipv6_address/ipv6_address.h> #include <unordered_set> -class TIpv6AddressTest: public TTestBase { +class TIpv6AddressTest: public TTestBase { UNIT_TEST_SUITE(TIpv6AddressTest); UNIT_TEST(ParseHostAndMayBePortFromString_data); UNIT_TEST(CheckAddressValidity) @@ -19,7 +19,7 @@ UNIT_TEST_SUITE_REGISTRATION(TIpv6AddressTest); using TResult = std::tuple<THostAddressAndPort, TString, TIpPort>; TResult IpRes(TString Ip, TIpPort Port) { - bool Ok; + bool Ok; THostAddressAndPort HostAddressAndPort; HostAddressAndPort.Ip = TIpv6Address::FromString(Ip, Ok); Y_VERIFY(Ok); @@ -30,24 +30,24 @@ TResult HostRes(TString HostName, TIpPort Port) { return TResult({}, HostName, Port); } -void ParseHostAndMayBePortFromString(TString RawStr, - TIpPort DefaultPort, +void ParseHostAndMayBePortFromString(TString RawStr, + TIpPort DefaultPort, const TResult ExpectedResult, - const bool ExpectedOk) { - bool Ok = false; + const bool ExpectedOk) { + bool Ok = false; const TResult ActualResult = ParseHostAndMayBePortFromString(RawStr, DefaultPort, Ok); UNIT_ASSERT(Ok == ExpectedOk); - if (Ok == false) + if (Ok == false) return; UNIT_ASSERT(ActualResult == ExpectedResult); } -void CheckIpDefPortAgainstIpPortDefPort_v4OrHost(TString Ip, - TIpPort Port, +void CheckIpDefPortAgainstIpPortDefPort_v4OrHost(TString Ip, + TIpPort Port, const TResult ExpectedResult, - const bool ExpectedOk) { + const bool ExpectedOk) { ParseHostAndMayBePortFromString(Ip, Port, ExpectedResult, ExpectedOk); TString New = Ip + ":" + ToString(Port); @@ -62,7 +62,7 @@ void CheckIpDefPortAgainstIpPortDefPort_v6(TString Ip, TIpPort Port, const TResu } void CheckIpDefPortAgainstIpPortDefPort(TString Ip, TIpPort Port, const TResult ExpectedResult, const bool ExpectedOk) { - if (Ip.find(':') == TString::npos) { + if (Ip.find(':') == TString::npos) { CheckIpDefPortAgainstIpPortDefPort_v4OrHost(Ip, Port, ExpectedResult, ExpectedOk); } else { CheckIpDefPortAgainstIpPortDefPort_v6(Ip, Port, ExpectedResult, ExpectedOk); |