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 | |
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')
-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 558aba9e2d1..c8d33b9d558 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 e38a35c426f..59241be3f4e 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 f8556a3fcef..148595b9ee0 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 3fdd175d736..be44a119d28 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); +} |