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 | dad82c0e0157ebad6bfd7cf0e5fb3c15c42922b3 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | d2ba528d19d736bd3424ea63017a589baef70154 (diff) | |
download | ydb-dad82c0e0157ebad6bfd7cf0e5fb3c15c42922b3.tar.gz |
Restoring authorship annotation for <egoregor@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | library/cpp/histogram/adaptive/fixed_bin_histogram.cpp | 8 | ||||
-rw-r--r-- | library/cpp/messagebus/locator.cpp | 2 | ||||
-rw-r--r-- | library/cpp/messagebus/locator.h | 2 | ||||
-rw-r--r-- | library/cpp/messagebus/test/ut/locator_uniq_ut.cpp | 56 |
4 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp index c8d33b9d55..558aba9e2d 100644 --- a/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp +++ b/library/cpp/histogram/adaptive/fixed_bin_histogram.cpp @@ -496,10 +496,10 @@ namespace NKiwiAggr { } double TFixedBinHistogram::CalcDensity(double value) { - i32 bin = CalcBin(value); - if (bin < 0 || bin >= (i32)Freqs.size() || BinRange == 0.0 || GetSum() == 0) { - return 0.0; - } + i32 bin = CalcBin(value); + if (bin < 0 || bin >= (i32)Freqs.size() || BinRange == 0.0 || GetSum() == 0) { + return 0.0; + } return Freqs[bin] / GetSum() / BinRange; } diff --git a/library/cpp/messagebus/locator.cpp b/library/cpp/messagebus/locator.cpp index 59241be3f4..e38a35c426 100644 --- a/library/cpp/messagebus/locator.cpp +++ b/library/cpp/messagebus/locator.cpp @@ -129,7 +129,7 @@ namespace NBus { return true; } } - + return false; } diff --git a/library/cpp/messagebus/locator.h b/library/cpp/messagebus/locator.h index 148595b9ee..f8556a3fce 100644 --- a/library/cpp/messagebus/locator.h +++ b/library/cpp/messagebus/locator.h @@ -40,7 +40,7 @@ namespace NBus { TItem(TServiceId serviceId, TBusKey start, TBusKey end, const TNetAddr& addr); }; - + typedef TMultiSet<TItem> TItems; TItems Items; TMutex Lock; diff --git a/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp b/library/cpp/messagebus/test/ut/locator_uniq_ut.cpp index be44a119d2..3fdd175d73 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); +} |