diff options
author | egoregor <egoregor@yandex-team.ru> | 2022-02-10 16:50:28 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:28 +0300 |
commit | d2ba528d19d736bd3424ea63017a589baef70154 (patch) | |
tree | 3caa96b1b89d2c8abfd7b136464521060eeeba9d /library/cpp/messagebus/test | |
parent | 9d0e9c90c05aacc70c91ef99d5b4724af73a591f (diff) | |
download | ydb-d2ba528d19d736bd3424ea63017a589baef70154.tar.gz |
Restoring authorship annotation for <egoregor@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/test')
-rw-r--r-- | library/cpp/messagebus/test/ut/locator_uniq_ut.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp index 3fdd175d73..be44a119d2 100644 --- a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp +++ b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp @@ -1,40 +1,40 @@ #include <library/cpp/testing/unittest/registar.h> - + #include <library/cpp/messagebus/test_utils.h> #include <library/cpp/messagebus/ybus.h> -class TLocatorRegisterUniqTest: public TTestBase { +class TLocatorRegisterUniqTest: public TTestBase { UNIT_TEST_SUITE(TLocatorRegisterUniqTest); UNIT_TEST(TestRegister); UNIT_TEST_SUITE_END(); - + protected: void TestRegister(); -}; - -UNIT_TEST_SUITE_REGISTRATION(TLocatorRegisterUniqTest); - -void TLocatorRegisterUniqTest::TestRegister() { +}; + +UNIT_TEST_SUITE_REGISTRATION(TLocatorRegisterUniqTest); + +void TLocatorRegisterUniqTest::TestRegister() { ASSUME_IP_V4_ENABLED; - NBus::TBusLocator locator; - const char* serviceName = "TestService"; - const char* hostName = "192.168.0.42"; - int port = 31337; - - NBus::TBusKeyVec keys; - locator.LocateKeys(serviceName, keys); - UNIT_ASSERT(keys.size() == 0); - - locator.Register(serviceName, hostName, port); - locator.LocateKeys(serviceName, keys); - /// YBUS_KEYMIN YBUS_KEYMAX range - UNIT_ASSERT(keys.size() == 1); - + NBus::TBusLocator locator; + const char* serviceName = "TestService"; + const char* hostName = "192.168.0.42"; + int port = 31337; + + NBus::TBusKeyVec keys; + locator.LocateKeys(serviceName, keys); + UNIT_ASSERT(keys.size() == 0); + + locator.Register(serviceName, hostName, port); + locator.LocateKeys(serviceName, keys); + /// YBUS_KEYMIN YBUS_KEYMAX range + UNIT_ASSERT(keys.size() == 1); + TVector<NBus::TNetAddr> hosts; - UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1); - - locator.Register(serviceName, hostName, port); - hosts.clear(); - UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1); -} + UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1); + + locator.Register(serviceName, hostName, port); + hosts.clear(); + UNIT_ASSERT(locator.LocateAll(serviceName, NBus::YBUS_KEYMIN, hosts) == 1); +} |