diff options
author | iaz1607 <iaz1607@yandex-team.ru> | 2022-02-10 16:45:37 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:37 +0300 |
commit | e5437feb4ac2d2dc044e1090b9312dde5ef197e0 (patch) | |
tree | f5a238c69dd20a1fa2092127a31b8aff25020f7d /util | |
parent | f4945d0a44b8770f0801de3056aa41639b0b7bd2 (diff) | |
download | ydb-e5437feb4ac2d2dc044e1090b9312dde5ef197e0.tar.gz |
Restoring authorship annotation for <iaz1607@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/charset/wide_ut.cpp | 24 | ||||
-rw-r--r-- | util/generic/hash_ut.cpp | 28 | ||||
-rw-r--r-- | util/generic/lazy_value_ut.cpp | 6 | ||||
-rw-r--r-- | util/generic/maybe_ut.cpp | 6 | ||||
-rw-r--r-- | util/generic/ptr_ut.cpp | 42 | ||||
-rw-r--r-- | util/generic/size_literals_ut.cpp | 4 | ||||
-rw-r--r-- | util/generic/string_ut.cpp | 212 | ||||
-rw-r--r-- | util/generic/typetraits_ut.cpp | 2 | ||||
-rw-r--r-- | util/network/endpoint.cpp | 2 | ||||
-rw-r--r-- | util/network/socket_ut.cpp | 14 | ||||
-rw-r--r-- | util/random/init_atfork.cpp | 2 | ||||
-rw-r--r-- | util/stream/input_ut.cpp | 8 | ||||
-rw-r--r-- | util/system/compat.cpp | 4 | ||||
-rw-r--r-- | util/system/compiler_ut.cpp | 8 | ||||
-rw-r--r-- | util/system/event_ut.cpp | 12 | ||||
-rw-r--r-- | util/system/file.cpp | 2 | ||||
-rw-r--r-- | util/system/mktemp_system.cpp | 2 | ||||
-rw-r--r-- | util/system/shellcommand_ut.cpp | 18 | ||||
-rw-r--r-- | util/system/types.cpp | 2 | ||||
-rw-r--r-- | util/thread/lfstack_ut.cpp | 14 |
20 files changed, 206 insertions, 206 deletions
diff --git a/util/charset/wide_ut.cpp b/util/charset/wide_ut.cpp index d8f3233e73..70c1b0af2d 100644 --- a/util/charset/wide_ut.cpp +++ b/util/charset/wide_ut.cpp @@ -163,8 +163,8 @@ namespace { class TConversionTest: public TTestBase { private: //! @note every of the text can have zeros in the middle - const TUtf16String UnicodeText_; - const TString Utf8Text_; + const TUtf16String UnicodeText_; + const TString Utf8Text_; private: UNIT_TEST_SUITE(TConversionTest); @@ -182,8 +182,8 @@ private: public: TConversionTest() - : UnicodeText_(CreateUnicodeText()) - , Utf8Text_(CreateUTF8Text()) + : UnicodeText_(CreateUnicodeText()) + , Utf8Text_(CreateUTF8Text()) { } @@ -466,13 +466,13 @@ static void TestSurrogates(const char* str, const wchar16* wide, size_t wideSize } void TConversionTest::TestUTF8ToWide() { - TUtf16String w = UTF8ToWide(Utf8Text_); + TUtf16String w = UTF8ToWide(Utf8Text_); UNIT_ASSERT(w.size() == 256); - UNIT_ASSERT(w.size() == UnicodeText_.size()); + UNIT_ASSERT(w.size() == UnicodeText_.size()); for (int i = 0; i < 256; ++i) { - UNIT_ASSERT_VALUES_EQUAL(w[i], UnicodeText_[i]); + UNIT_ASSERT_VALUES_EQUAL(w[i], UnicodeText_[i]); } wchar16 buffer[4] = {0}; @@ -516,23 +516,23 @@ void TConversionTest::TestUTF8ToWide() { } void TConversionTest::TestWideToUTF8() { - TString s = WideToUTF8(UnicodeText_); + TString s = WideToUTF8(UnicodeText_); size_t len = 0; - for (TUtf16String::const_iterator i = UnicodeText_.begin(), ie = UnicodeText_.end(); i != ie; ++i) { + for (TUtf16String::const_iterator i = UnicodeText_.begin(), ie = UnicodeText_.end(); i != ie; ++i) { len += UTF8RuneLenByUCS(*i); } - UNIT_ASSERT(s.size() == Utf8Text_.size()); + UNIT_ASSERT(s.size() == Utf8Text_.size()); UNIT_ASSERT(s.size() == len); for (int i = 0; i < static_cast<int>(s.size()); ++i) { - UNIT_ASSERT_VALUES_EQUAL(s[i], Utf8Text_[i]); + UNIT_ASSERT_VALUES_EQUAL(s[i], Utf8Text_[i]); } } void TConversionTest::TestGetNumOfUTF8Chars() { size_t n = 0; - bool result = GetNumberOfUTF8Chars(Utf8Text_.c_str(), Utf8Text_.size(), n); + bool result = GetNumberOfUTF8Chars(Utf8Text_.c_str(), Utf8Text_.size(), n); UNIT_ASSERT(result); UNIT_ASSERT(n == 256); diff --git a/util/generic/hash_ut.cpp b/util/generic/hash_ut.cpp index 0551d58770..e88425cbf1 100644 --- a/util/generic/hash_ut.cpp +++ b/util/generic/hash_ut.cpp @@ -559,20 +559,20 @@ void THashTest::TestHMSetEmplace() { public: TKey(NTesting::TProbeState* state, int key) : TProbe(state) - , Key_(key) + , Key_(key) { } operator size_t() const { - return THash<int>()(Key_); + return THash<int>()(Key_); } bool operator==(const TKey& other) const { - return Key_ == other.Key_; + return Key_ == other.Key_; } private: - int Key_; + int Key_; }; NTesting::TProbeState state; @@ -791,27 +791,27 @@ public: }; TCountingAllocator() - : Counters_(nullptr) + : Counters_(nullptr) { } TCountingAllocator(TAllocatorCounters* counters) - : Counters_(counters) + : Counters_(counters) { Y_ASSERT(counters); } template <class Other> TCountingAllocator(const TCountingAllocator<Other>& other) - : Counters_(other.Counters) + : Counters_(other.Counters) { } T* allocate(size_type n) { auto result = base_type::allocate(n); - if (Counters_) { - ++Counters_->Allocations; + if (Counters_) { + ++Counters_->Allocations; Counters_->Chunks.emplace(result, n * sizeof(T)); } @@ -819,16 +819,16 @@ public: } void deallocate(T* p, size_type n) { - if (Counters_) { - ++Counters_->Deallocations; - Counters_->Chunks.erase(std::make_pair(p, n * sizeof(T))); + if (Counters_) { + ++Counters_->Deallocations; + Counters_->Chunks.erase(std::make_pair(p, n * sizeof(T))); } base_type::deallocate(p, n); } private: - TAllocatorCounters* Counters_; + TAllocatorCounters* Counters_; }; void THashTest::TestAllocation() { @@ -1264,7 +1264,7 @@ void THashTest::TestTupleHash() { * for example */ struct A { - A Foo(const std::tuple<A, float>& v) { + A Foo(const std::tuple<A, float>& v) { return std::get<A>(v); } }; diff --git a/util/generic/lazy_value_ut.cpp b/util/generic/lazy_value_ut.cpp index f6135880c3..0891f5d13c 100644 --- a/util/generic/lazy_value_ut.cpp +++ b/util/generic/lazy_value_ut.cpp @@ -94,16 +94,16 @@ Y_UNIT_TEST_SUITE(TLazyValueTestSuite) { static size_t CountParseDataCalled; TValueProvider() - : Data_([&] { return this->ParseData(); }) + : Data_([&] { return this->ParseData(); }) { } const TString& GetData() const { - return *Data_; + return *Data_; } private: - TLazyValue<TString> Data_; + TLazyValue<TString> Data_; TString ParseData() { CountParseDataCalled++; diff --git a/util/generic/maybe_ut.cpp b/util/generic/maybe_ut.cpp index 2c1a425c5e..ff767d9be9 100644 --- a/util/generic/maybe_ut.cpp +++ b/util/generic/maybe_ut.cpp @@ -7,16 +7,16 @@ class TIncrementOnDestroy { private: - int* Ptr_; + int* Ptr_; public: TIncrementOnDestroy(int* ptr) noexcept - : Ptr_(ptr) + : Ptr_(ptr) { } ~TIncrementOnDestroy() { - ++*Ptr_; + ++*Ptr_; } }; diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp index c2dcff23f6..f4da1a38bf 100644 --- a/util/generic/ptr_ut.cpp +++ b/util/generic/ptr_ut.cpp @@ -110,7 +110,7 @@ public: } }; -static A* MakeA() { +static A* MakeA() { return new A(); } @@ -118,18 +118,18 @@ static A* MakeA() { * test compileability */ class B; -static TSimpleIntrusivePtr<B> GetB() { +static TSimpleIntrusivePtr<B> GetB() { throw 1; } -void Func() { - TSimpleIntrusivePtr<B> b = GetB(); +void Func() { + TSimpleIntrusivePtr<B> b = GetB(); } void TPointerTest::TestSimpleIntrPtr() { { - TSimpleIntrusivePtr<A> a1(MakeA()); - TSimpleIntrusivePtr<A> a2(MakeA()); + TSimpleIntrusivePtr<A> a1(MakeA()); + TSimpleIntrusivePtr<A> a2(MakeA()); TSimpleIntrusivePtr<A> a3 = a2; a1 = a2; @@ -141,7 +141,7 @@ void TPointerTest::TestSimpleIntrPtr() { void TPointerTest::TestHolderPtr() { { - THolder<A> a1(MakeA()); + THolder<A> a1(MakeA()); THolder<A> a2(a1.Release()); } @@ -217,20 +217,20 @@ void TPointerTest::TestMakeHolder() { { class TRec { private: - int X_, Y_; + int X_, Y_; public: TRec(int x, int y) - : X_(x) - , Y_(y) + : X_(x) + , Y_(y) { } int GetX() const { - return X_; + return X_; } int GetY() const { - return Y_; + return Y_; } }; auto ptr = MakeHolder<TRec>(1, 2); @@ -241,7 +241,7 @@ void TPointerTest::TestMakeHolder() { void TPointerTest::TestTrulePtr() { { - TAutoPtr<A> a1(MakeA()); + TAutoPtr<A> a1(MakeA()); TAutoPtr<A> a2(a1); a1 = a2; } @@ -251,7 +251,7 @@ void TPointerTest::TestTrulePtr() { void TPointerTest::TestAutoToHolder() { { - TAutoPtr<A> a1(MakeA()); + TAutoPtr<A> a1(MakeA()); THolder<A> a2(a1); UNIT_ASSERT_EQUAL(a1.Get(), nullptr); @@ -279,9 +279,9 @@ void TPointerTest::TestAutoToHolder() { } void TPointerTest::TestCopyPtr() { - TCopyPtr<A> a1(MakeA()); + TCopyPtr<A> a1(MakeA()); { - TCopyPtr<A> a2(MakeA()); + TCopyPtr<A> a2(MakeA()); TCopyPtr<A> a3 = a2; UNIT_ASSERT_VALUES_EQUAL(cnt, 3); @@ -650,20 +650,20 @@ void TPointerTest::TestMakeShared() { { class TRec { private: - int X_, Y_; + int X_, Y_; public: TRec(int x, int y) - : X_(x) - , Y_(y) + : X_(x) + , Y_(y) { } int GetX() const { - return X_; + return X_; } int GetY() const { - return Y_; + return Y_; } }; TSimpleSharedPtr<TRec> ptr = MakeSimpleShared<TRec>(1, 2); diff --git a/util/generic/size_literals_ut.cpp b/util/generic/size_literals_ut.cpp index 410e22c39d..4ab8136dfe 100644 --- a/util/generic/size_literals_ut.cpp +++ b/util/generic/size_literals_ut.cpp @@ -1,6 +1,6 @@ #include "size_literals.h" -void CompileTestUnsigned() { +void CompileTestUnsigned() { static_assert(1_KB == 1024, "Wrong 1KB value"); static_assert(3_KB == 3 * 1024, "Wrong 3KB value"); static_assert(41_KB == 41 * 1024, "Wrong 41KB value"); @@ -32,7 +32,7 @@ void CompileTestUnsigned() { static_assert(9000000_TB == 9000000_GB * 1024, "Wrong 9000000TB value"); } -void CompileTestSigned() { +void CompileTestSigned() { static_assert(1_KBs == 1024, "Wrong 1KBs value"); static_assert(3_KBs == 3 * 1024, "Wrong 3KBs value"); static_assert(41_KBs == 41 * 1024, "Wrong 41KBs value"); diff --git a/util/generic/string_ut.cpp b/util/generic/string_ut.cpp index ac82e9091d..63104220dd 100644 --- a/util/generic/string_ut.cpp +++ b/util/generic/string_ut.cpp @@ -74,13 +74,13 @@ class TStringStdTestImpl { using TTraits = typename TStringType::traits_type; using TView = std::basic_string_view<TChar, TTraits>; - TTestData Data_; + TTestData Data_; protected: - void Constructor() { + void Constructor() { // @todo use UNIT_TEST_EXCEPTION try { - TStringType s((size_t)-1, *Data_.a()); + TStringType s((size_t)-1, *Data_.a()); UNIT_ASSERT(false); } catch (const std::length_error&) { UNIT_ASSERT(true); @@ -151,10 +151,10 @@ protected: } void short_string() { - TStringType const ref_short_str1(Data_.str1()), ref_short_str2(Data_.str2()); + TStringType const ref_short_str1(Data_.str1()), ref_short_str2(Data_.str2()); TStringType short_str1(ref_short_str1), short_str2(ref_short_str2); - TStringType const ref_long_str1(Data_.str__________________________________________________1()); - TStringType const ref_long_str2(Data_.str__________________________________________________2()); + TStringType const ref_long_str1(Data_.str__________________________________________________1()); + TStringType const ref_long_str2(Data_.str__________________________________________________2()); TStringType long_str1(ref_long_str1), long_str2(ref_long_str2); UNIT_ASSERT(short_str1 == ref_short_str1); @@ -213,7 +213,7 @@ protected: } void erase() { - TChar const* c_str = Data_.Hello_World(); + TChar const* c_str = Data_.Hello_World(); TStringType str(c_str); UNIT_ASSERT(str == c_str); @@ -223,11 +223,11 @@ protected: for (i = 0; i < str.size(); ++i) { switch (i) { case 0: - UNIT_ASSERT(str[i] == *Data_.H()); + UNIT_ASSERT(str[i] == *Data_.H()); break; case 1: - UNIT_ASSERT(str[i] == *Data_.d()); + UNIT_ASSERT(str[i] == *Data_.d()); break; default: @@ -249,11 +249,11 @@ protected: for (i = 0; i < str.size(); i++) { switch (i) { case 0: - UNIT_ASSERT(str[i] == *Data_.H()); + UNIT_ASSERT(str[i] == *Data_.H()); break; case 1: - UNIT_ASSERT(str[i] == *Data_.d()); + UNIT_ASSERT(str[i] == *Data_.d()); break; default: @@ -262,7 +262,7 @@ protected: } str.erase(1); - UNIT_ASSERT(str == Data_.H()); + UNIT_ASSERT(str == Data_.H()); } void data() { @@ -273,7 +273,7 @@ protected: } void c_str() { - TStringType low(Data_._2004_01_01()); + TStringType low(Data_._2004_01_01()); TStringType xx; TStringType yy; @@ -282,15 +282,15 @@ protected: // Blocks A and B should follow each other. // Block A: - xx = Data_._123456(); + xx = Data_._123456(); xx += low; - UNIT_ASSERT(xx.c_str() == TView(Data_._1234562004_01_01())); + UNIT_ASSERT(xx.c_str() == TView(Data_._1234562004_01_01())); // End of block A // Block B: - xx = Data_._1234(); - xx += Data_._5(); - UNIT_ASSERT(xx.c_str() == TView(Data_._12345())); + xx = Data_._1234(); + xx += Data_._5(); + UNIT_ASSERT(xx.c_str() == TView(Data_._12345())); // End of block B } @@ -302,7 +302,7 @@ protected: void null_char() { // ISO/IEC 14882:1998(E), ISO/IEC 14882:2003(E), 21.3.4 ('... the const version') - const TStringType s(Data_._123456()); + const TStringType s(Data_._123456()); UNIT_ASSERT(s[s.size()] == 0); } @@ -356,7 +356,7 @@ protected: #endif void insert() { - TStringType strorg = Data_.This_is_test_string_for_string_calls(); + TStringType strorg = Data_.This_is_test_string_for_string_calls(); TStringType str; // In case of reallocation there is no auto reference problem @@ -368,26 +368,26 @@ protected: //test self insertion: str.insert(10, str.c_str() + 5, 15); - UNIT_ASSERT(str == Data_.This_is_teis_test_string_st_string_for_string_calls()); + UNIT_ASSERT(str == Data_.This_is_teis_test_string_st_string_for_string_calls()); str = strorg; str.insert(15, str.c_str() + 5, 25); - UNIT_ASSERT(str == Data_.This_is_test_stis_test_string_for_stringring_for_string_calls()); + UNIT_ASSERT(str == Data_.This_is_test_stis_test_string_for_stringring_for_string_calls()); str = strorg; str.insert(0, str.c_str() + str.size() - 4, 4); - UNIT_ASSERT(str == Data_.allsThis_is_test_string_for_string_calls()); + UNIT_ASSERT(str == Data_.allsThis_is_test_string_for_string_calls()); str = strorg; str.insert(0, str.c_str() + str.size() / 2 - 1, str.size() / 2 + 1); - UNIT_ASSERT(str == Data_.ng_for_string_callsThis_is_test_string_for_string_calls()); + UNIT_ASSERT(str == Data_.ng_for_string_callsThis_is_test_string_for_string_calls()); str = strorg; typename TStringType::iterator b = str.begin(); typename TStringType::const_iterator s = str.begin() + str.size() / 2 - 1; typename TStringType::const_iterator e = str.end(); str.insert(b, s, e); - UNIT_ASSERT(str == Data_.ng_for_string_callsThis_is_test_string_for_string_calls()); + UNIT_ASSERT(str == Data_.ng_for_string_callsThis_is_test_string_for_string_calls()); #if 0 // AV @@ -397,34 +397,34 @@ protected: #endif TStringType str0; - str0.insert(str0.begin(), 5, *Data_._0()); - UNIT_ASSERT(str0 == Data_._00000()); + str0.insert(str0.begin(), 5, *Data_._0()); + UNIT_ASSERT(str0 == Data_._00000()); TStringType str1; { typename TStringType::size_type pos = 0, nb = 2; - str1.insert(pos, nb, *Data_._1()); + str1.insert(pos, nb, *Data_._1()); } - UNIT_ASSERT(str1 == Data_._11()); + UNIT_ASSERT(str1 == Data_._11()); str0.insert(0, str1); - UNIT_ASSERT(str0 == Data_._1100000()); + UNIT_ASSERT(str0 == Data_._1100000()); - TStringType str2(Data_._2345()); + TStringType str2(Data_._2345()); str0.insert(str0.size(), str2, 1, 2); - UNIT_ASSERT(str0 == Data_._110000034()); + UNIT_ASSERT(str0 == Data_._110000034()); - str1.insert(str1.begin() + 1, 2, *Data_._2()); - UNIT_ASSERT(str1 == Data_._1221()); + str1.insert(str1.begin() + 1, 2, *Data_._2()); + UNIT_ASSERT(str1 == Data_._1221()); - str1.insert(2, Data_._333333(), 3); - UNIT_ASSERT(str1 == Data_._1233321()); + str1.insert(2, Data_._333333(), 3); + UNIT_ASSERT(str1 == Data_._1233321()); - str1.insert(4, Data_._4444()); - UNIT_ASSERT(str1 == Data_._12334444321()); + str1.insert(4, Data_._4444()); + UNIT_ASSERT(str1 == Data_._12334444321()); - str1.insert(str1.begin() + 6, *Data_._5()); - UNIT_ASSERT(str1 == Data_._123344544321()); + str1.insert(str1.begin() + 6, *Data_._5()); + UNIT_ASSERT(str1 == Data_._123344544321()); } void resize() { @@ -434,41 +434,41 @@ protected: UNIT_ASSERT(*s.c_str() == 0); - s = Data_._1234567(); + s = Data_._1234567(); s.resize(0); UNIT_ASSERT(*s.c_str() == 0); - s = Data_._1234567(); + s = Data_._1234567(); s.resize(1); UNIT_ASSERT(s.size() == 1); - UNIT_ASSERT(*s.c_str() == *Data_._1()); + UNIT_ASSERT(*s.c_str() == *Data_._1()); UNIT_ASSERT(*(s.c_str() + 1) == 0); - s = Data_._1234567(); + s = Data_._1234567(); #if 0 s.resize(10); #else s.resize(10, 0); #endif UNIT_ASSERT(s.size() == 10); - UNIT_ASSERT(s[6] == *Data_._7()); + UNIT_ASSERT(s[6] == *Data_._7()); UNIT_ASSERT(s[7] == 0); UNIT_ASSERT(s[8] == 0); UNIT_ASSERT(s[9] == 0); } void find() { - TStringType s(Data_.one_two_three_one_two_three()); + TStringType s(Data_.one_two_three_one_two_three()); - UNIT_ASSERT(s.find(Data_.one()) == 0); - UNIT_ASSERT(s.find(*Data_.t()) == 4); - UNIT_ASSERT(s.find(*Data_.t(), 5) == 8); + UNIT_ASSERT(s.find(Data_.one()) == 0); + UNIT_ASSERT(s.find(*Data_.t()) == 4); + UNIT_ASSERT(s.find(*Data_.t(), 5) == 8); - UNIT_ASSERT(s.find(Data_.four()) == TStringType::npos); - UNIT_ASSERT(s.find(Data_.one(), TStringType::npos) == TStringType::npos); - UNIT_ASSERT(s.find_first_of(Data_.abcde()) == 2); - UNIT_ASSERT(s.find_first_not_of(Data_.enotw_()) == 9); + UNIT_ASSERT(s.find(Data_.four()) == TStringType::npos); + UNIT_ASSERT(s.find(Data_.one(), TStringType::npos) == TStringType::npos); + UNIT_ASSERT(s.find_first_of(Data_.abcde()) == 2); + UNIT_ASSERT(s.find_first_not_of(Data_.enotw_()) == 9); } void capacity() { @@ -488,12 +488,12 @@ protected: void assign() { TStringType s; - TChar const* cstr = Data_.test_string_for_assign(); + TChar const* cstr = Data_.test_string_for_assign(); s.assign(cstr, cstr + 22); - UNIT_ASSERT(s == Data_.test_string_for_assign()); + UNIT_ASSERT(s == Data_.test_string_for_assign()); - TStringType s2(Data_.other_test_string()); + TStringType s2(Data_.other_test_string()); s.assign(s2); UNIT_ASSERT(s == s2); @@ -501,29 +501,29 @@ protected: static TStringType str2; // short TStringType optim: - str1 = Data_._123456(); + str1 = Data_._123456(); // longer than short TStringType: - str2 = Data_._1234567890123456789012345678901234567890(); + str2 = Data_._1234567890123456789012345678901234567890(); - UNIT_ASSERT(str1[5] == *Data_._6()); - UNIT_ASSERT(str2[29] == *Data_._0()); + UNIT_ASSERT(str1[5] == *Data_._6()); + UNIT_ASSERT(str2[29] == *Data_._0()); } void copy() { - TStringType s(Data_.foo()); + TStringType s(Data_.foo()); TChar dest[4]; dest[0] = dest[1] = dest[2] = dest[3] = 1; s.copy(dest, 4); int pos = 0; - UNIT_ASSERT(dest[pos++] == *Data_.f()); - UNIT_ASSERT(dest[pos++] == *Data_.o()); - UNIT_ASSERT(dest[pos++] == *Data_.o()); + UNIT_ASSERT(dest[pos++] == *Data_.f()); + UNIT_ASSERT(dest[pos++] == *Data_.o()); + UNIT_ASSERT(dest[pos++] == *Data_.o()); UNIT_ASSERT(dest[pos++] == 1); dest[0] = dest[1] = dest[2] = dest[3] = 1; s.copy(dest, 4, 2); pos = 0; - UNIT_ASSERT(dest[pos++] == *Data_.o()); + UNIT_ASSERT(dest[pos++] == *Data_.o()); UNIT_ASSERT(dest[pos++] == 1); // @todo use UNIT_TEST_EXCEPTION @@ -547,56 +547,56 @@ protected: } void compare() { - TStringType str1(Data_.abcdef()); + TStringType str1(Data_.abcdef()); TStringType str2; - str2 = Data_.abcdef(); + str2 = Data_.abcdef(); UNIT_ASSERT(str1.compare(str2) == 0); UNIT_ASSERT(str1.compare(str2.data(), str2.size()) == 0); - str2 = Data_.abcde(); + str2 = Data_.abcde(); UNIT_ASSERT(str1.compare(str2) > 0); UNIT_ASSERT(str1.compare(str2.data(), str2.size()) > 0); - str2 = Data_.abcdefg(); + str2 = Data_.abcdefg(); UNIT_ASSERT(str1.compare(str2) < 0); UNIT_ASSERT(str1.compare(str2.data(), str2.size()) < 0); - UNIT_ASSERT(str1.compare(Data_.abcdef()) == 0); - UNIT_ASSERT(str1.compare(Data_.abcde()) > 0); - UNIT_ASSERT(str1.compare(Data_.abcdefg()) < 0); + UNIT_ASSERT(str1.compare(Data_.abcdef()) == 0); + UNIT_ASSERT(str1.compare(Data_.abcde()) > 0); + UNIT_ASSERT(str1.compare(Data_.abcdefg()) < 0); - str2 = Data_.cde(); + str2 = Data_.cde(); UNIT_ASSERT(str1.compare(2, 3, str2) == 0); - str2 = Data_.cd(); + str2 = Data_.cd(); UNIT_ASSERT(str1.compare(2, 3, str2) > 0); - str2 = Data_.cdef(); + str2 = Data_.cdef(); UNIT_ASSERT(str1.compare(2, 3, str2) < 0); - str2 = Data_.abcdef(); + str2 = Data_.abcdef(); UNIT_ASSERT(str1.compare(2, 3, str2, 2, 3) == 0); UNIT_ASSERT(str1.compare(2, 3, str2, 2, 2) > 0); UNIT_ASSERT(str1.compare(2, 3, str2, 2, 4) < 0); - UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 3) == 0); - UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 2) > 0); - UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 4) < 0); + UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 3) == 0); + UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 2) > 0); + UNIT_ASSERT(str1.compare(2, 3, Data_.cdefgh(), 4) < 0); } void find_last_of() { // 21.3.6.4 - TStringType s(Data_.one_two_three_one_two_three()); + TStringType s(Data_.one_two_three_one_two_three()); - UNIT_ASSERT(s.find_last_of(Data_.abcde()) == 26); - UNIT_ASSERT(s.find_last_of(TStringType(Data_.abcde())) == 26); + UNIT_ASSERT(s.find_last_of(Data_.abcde()) == 26); + UNIT_ASSERT(s.find_last_of(TStringType(Data_.abcde())) == 26); - TStringType test(Data_.aba()); + TStringType test(Data_.aba()); - UNIT_ASSERT(test.find_last_of(Data_.a(), 2, 1) == 2); - UNIT_ASSERT(test.find_last_of(Data_.a(), 1, 1) == 0); - UNIT_ASSERT(test.find_last_of(Data_.a(), 0, 1) == 0); + UNIT_ASSERT(test.find_last_of(Data_.a(), 2, 1) == 2); + UNIT_ASSERT(test.find_last_of(Data_.a(), 1, 1) == 0); + UNIT_ASSERT(test.find_last_of(Data_.a(), 0, 1) == 0); - UNIT_ASSERT(test.find_last_of(*Data_.a(), 2) == 2); - UNIT_ASSERT(test.find_last_of(*Data_.a(), 1) == 0); - UNIT_ASSERT(test.find_last_of(*Data_.a(), 0) == 0); + UNIT_ASSERT(test.find_last_of(*Data_.a(), 2) == 2); + UNIT_ASSERT(test.find_last_of(*Data_.a(), 1) == 0); + UNIT_ASSERT(test.find_last_of(*Data_.a(), 0) == 0); } #if 0 void rfind() { @@ -621,25 +621,25 @@ protected: #endif void find_last_not_of() { // 21.3.6.6 - TStringType s(Data_.one_two_three_one_two_three()); + TStringType s(Data_.one_two_three_one_two_three()); - UNIT_ASSERT(s.find_last_not_of(Data_.ehortw_()) == 15); + UNIT_ASSERT(s.find_last_not_of(Data_.ehortw_()) == 15); - TStringType test(Data_.aba()); + TStringType test(Data_.aba()); - UNIT_ASSERT(test.find_last_not_of(Data_.a(), 2, 1) == 1); - UNIT_ASSERT(test.find_last_not_of(Data_.b(), 2, 1) == 2); - UNIT_ASSERT(test.find_last_not_of(Data_.a(), 1, 1) == 1); - UNIT_ASSERT(test.find_last_not_of(Data_.b(), 1, 1) == 0); - UNIT_ASSERT(test.find_last_not_of(Data_.a(), 0, 1) == TStringType::npos); - UNIT_ASSERT(test.find_last_not_of(Data_.b(), 0, 1) == 0); + UNIT_ASSERT(test.find_last_not_of(Data_.a(), 2, 1) == 1); + UNIT_ASSERT(test.find_last_not_of(Data_.b(), 2, 1) == 2); + UNIT_ASSERT(test.find_last_not_of(Data_.a(), 1, 1) == 1); + UNIT_ASSERT(test.find_last_not_of(Data_.b(), 1, 1) == 0); + UNIT_ASSERT(test.find_last_not_of(Data_.a(), 0, 1) == TStringType::npos); + UNIT_ASSERT(test.find_last_not_of(Data_.b(), 0, 1) == 0); - UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 2) == 1); - UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 2) == 2); - UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 1) == 1); - UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 1) == 0); - UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 0) == TStringType::npos); - UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 0) == 0); + UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 2) == 1); + UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 2) == 2); + UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 1) == 1); + UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 1) == 0); + UNIT_ASSERT(test.find_last_not_of(*Data_.a(), 0) == TStringType::npos); + UNIT_ASSERT(test.find_last_not_of(*Data_.b(), 0) == 0); } #if 0 void replace() { @@ -1108,7 +1108,7 @@ UNIT_TEST_SUITE_REGISTRATION(TUtf32StringTest); class TStringStdTest: public TTestBase, private TStringStdTestImpl<TString, TTestData<char>> { public: UNIT_TEST_SUITE(TStringStdTest); - UNIT_TEST(Constructor); + UNIT_TEST(Constructor); UNIT_TEST(reserve); UNIT_TEST(short_string); UNIT_TEST(erase); @@ -1144,7 +1144,7 @@ UNIT_TEST_SUITE_REGISTRATION(TStringStdTest); class TWideStringStdTest: public TTestBase, private TStringStdTestImpl<TUtf16String, TTestData<wchar16>> { public: UNIT_TEST_SUITE(TWideStringStdTest); - UNIT_TEST(Constructor); + UNIT_TEST(Constructor); UNIT_TEST(reserve); UNIT_TEST(short_string); UNIT_TEST(erase); diff --git a/util/generic/typetraits_ut.cpp b/util/generic/typetraits_ut.cpp index e7571c75ec..0ba88813e9 100644 --- a/util/generic/typetraits_ut.cpp +++ b/util/generic/typetraits_ut.cpp @@ -59,7 +59,7 @@ namespace { class TNonStdLayoutClass2 { public: - virtual void Func() { + virtual void Func() { } }; diff --git a/util/network/endpoint.cpp b/util/network/endpoint.cpp index 9acdd06940..c2e2720c46 100644 --- a/util/network/endpoint.cpp +++ b/util/network/endpoint.cpp @@ -1,5 +1,5 @@ #include "endpoint.h" -#include "sock.h" +#include "sock.h" TEndpoint::TEndpoint(const TEndpoint::TAddrRef& addr) : Addr_(addr) diff --git a/util/network/socket_ut.cpp b/util/network/socket_ut.cpp index 6b20e11f70..789f5f7e73 100644 --- a/util/network/socket_ut.cpp +++ b/util/network/socket_ut.cpp @@ -104,16 +104,16 @@ void TSockTest::TestNetworkResolutionErrorMessage() { struct TErrnoGuard { TErrnoGuard() - : PrevValue_(errno) + : PrevValue_(errno) { } ~TErrnoGuard() { - errno = PrevValue_; + errno = PrevValue_; } private: - int PrevValue_; + int PrevValue_; } g; UNIT_ASSERT_VALUES_EQUAL(expected(0) + "(0): ", str(0)); @@ -131,17 +131,17 @@ void TSockTest::TestNetworkResolutionErrorMessage() { class TTempEnableSigPipe { public: TTempEnableSigPipe() { - OriginalSigHandler_ = signal(SIGPIPE, SIG_DFL); - Y_VERIFY(OriginalSigHandler_ != SIG_ERR); + OriginalSigHandler_ = signal(SIGPIPE, SIG_DFL); + Y_VERIFY(OriginalSigHandler_ != SIG_ERR); } ~TTempEnableSigPipe() { - auto ret = signal(SIGPIPE, OriginalSigHandler_); + auto ret = signal(SIGPIPE, OriginalSigHandler_); Y_VERIFY(ret != SIG_ERR); } private: - void (*OriginalSigHandler_)(int); + void (*OriginalSigHandler_)(int); }; void TSockTest::TestBrokenPipe() { diff --git a/util/random/init_atfork.cpp b/util/random/init_atfork.cpp index 0faa3d119a..162a26d0ac 100644 --- a/util/random/init_atfork.cpp +++ b/util/random/init_atfork.cpp @@ -3,7 +3,7 @@ #include "entropy.h" #include <util/generic/singleton.h> -#include <util/system/yassert.h> +#include <util/system/yassert.h> #if defined(_unix_) #include <pthread.h> diff --git a/util/stream/input_ut.cpp b/util/stream/input_ut.cpp index 4a93f5458e..b4ba4a52e2 100644 --- a/util/stream/input_ut.cpp +++ b/util/stream/input_ut.cpp @@ -13,11 +13,11 @@ class TMockStdIn { public: TMockStdIn() - : StdInCopy_(dup(0)) + : StdInCopy_(dup(0)) { } ~TMockStdIn() { - close(StdInCopy_); + close(StdInCopy_); } template <typename FuncType> @@ -33,12 +33,12 @@ public: func(); Cin.ReadAll(); - dup2(StdInCopy_, 0); + dup2(StdInCopy_, 0); clearerr(stdin); } private: - int StdInCopy_; + int StdInCopy_; }; class TNoInput: public IInputStream { diff --git a/util/system/compat.cpp b/util/system/compat.cpp index 18fbfa296a..0c4bf23e9f 100644 --- a/util/system/compat.cpp +++ b/util/system/compat.cpp @@ -9,8 +9,8 @@ #include <cstdarg> #include <cstdlib> -#include <util/generic/string.h> - +#include <util/generic/string.h> + #ifdef _win_ #include "winint.h" #include <io.h> diff --git a/util/system/compiler_ut.cpp b/util/system/compiler_ut.cpp index f93b1c0850..317376f984 100644 --- a/util/system/compiler_ut.cpp +++ b/util/system/compiler_ut.cpp @@ -24,14 +24,14 @@ Y_UNIT_TEST_SUITE(TCompilerTest) { // define function with unused named parameter // and there will be no warning for this - int Foo(int a) { + int Foo(int a) { return 0; } Y_PRAGMA_DIAGNOSTIC_POP Y_UNIT_TEST(TestPragmaNoUnusedParameter) { - UNIT_ASSERT_EQUAL(Foo(1), 0); + UNIT_ASSERT_EQUAL(Foo(1), 0); } Y_UNIT_TEST(TestHaveInt128) { @@ -56,7 +56,7 @@ Y_UNIT_TEST_SUITE(TCompilerTest) { } // define deprecated function - [[deprecated]] void Bar() { + [[deprecated]] void Bar() { return; } @@ -65,7 +65,7 @@ Y_UNIT_TEST_SUITE(TCompilerTest) { Y_PRAGMA_NO_DEPRECATED // will be compiled without errors - Bar(); + Bar(); Y_PRAGMA_DIAGNOSTIC_POP } diff --git a/util/system/event_ut.cpp b/util/system/event_ut.cpp index 2506cb7a91..ad7bfcb7da 100644 --- a/util/system/event_ut.cpp +++ b/util/system/event_ut.cpp @@ -50,16 +50,16 @@ namespace { class TSignalTask: public IObjectInQueue { private: - TManualEvent& Ev_; + TManualEvent& Ev_; public: - TSignalTask(TManualEvent& ev) - : Ev_(ev) + TSignalTask(TManualEvent& ev) + : Ev_(ev) { } void Process(void*) override { - Ev_.Signal(); + Ev_.Signal(); } }; @@ -103,7 +103,7 @@ Y_UNIT_TEST_SUITE(EventTest) { queue.Start(limit); TVector<THolder<IObjectInQueue>> tasks; for (size_t i = 0; i < limit; ++i) { - tasks.emplace_back(MakeHolder<TSignalTask>(event[i])); + tasks.emplace_back(MakeHolder<TSignalTask>(event[i])); UNIT_ASSERT(queue.Add(tasks.back().Get())); } for (size_t i = limit; i != 0; --i) { @@ -118,7 +118,7 @@ Y_UNIT_TEST_SUITE(EventTest) { TVector<THolder<IObjectInQueue>> tasks; for (size_t i = 0; i < 1000; ++i) { auto owner = MakeHolder<TOwnerTask>(); - tasks.emplace_back(MakeHolder<TSignalTask>(*owner->Ev)); + tasks.emplace_back(MakeHolder<TSignalTask>(*owner->Ev)); tasks.emplace_back(std::move(owner)); } diff --git a/util/system/file.cpp b/util/system/file.cpp index 4a261d020c..9c52ee1d83 100644 --- a/util/system/file.cpp +++ b/util/system/file.cpp @@ -3,7 +3,7 @@ #include "fstat.h" #include "sysstat.h" #include "align.h" -#include "info.h" +#include "info.h" #include <array> diff --git a/util/system/mktemp_system.cpp b/util/system/mktemp_system.cpp index 32bea2987c..525f82ebee 100644 --- a/util/system/mktemp_system.cpp +++ b/util/system/mktemp_system.cpp @@ -165,7 +165,7 @@ GetTemp(char* path, int* doopen, int domkdir, int slen) extern "C" int mkstemps(char* path, int slen) { int fd; - return (GetTemp(path, &fd, 0, slen) ? fd : -1); + return (GetTemp(path, &fd, 0, slen) ? fd : -1); } #if defined(_win_) diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 9d849279d2..335d421e55 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -30,33 +30,33 @@ const size_t textSize = 20000; class TGuardedStringStream: public IInputStream, public IOutputStream { public: TGuardedStringStream() { - Stream_.Reserve(100); + Stream_.Reserve(100); } TString Str() const { - with_lock (Lock_) { - return Stream_.Str(); + with_lock (Lock_) { + return Stream_.Str(); } return TString(); // line for compiler } protected: size_t DoRead(void* buf, size_t len) override { - with_lock (Lock_) { - return Stream_.Read(buf, len); + with_lock (Lock_) { + return Stream_.Read(buf, len); } return 0; // line for compiler } void DoWrite(const void* buf, size_t len) override { - with_lock (Lock_) { - return Stream_.Write(buf, len); + with_lock (Lock_) { + return Stream_.Write(buf, len); } } private: - TAdaptiveLock Lock_; - TStringStream Stream_; + TAdaptiveLock Lock_; + TStringStream Stream_; }; Y_UNIT_TEST_SUITE(TShellQuoteTest) { diff --git a/util/system/types.cpp b/util/system/types.cpp index 11cc72aee3..ce676d1e69 100644 --- a/util/system/types.cpp +++ b/util/system/types.cpp @@ -1,7 +1,7 @@ #include "types.h" #include <util/generic/typetraits.h> -#include <util/generic/typelist.h> +#include <util/generic/typelist.h> static_assert(sizeof(ui8) == 1, "incorrect ui8 type"); static_assert(sizeof(ui16) == 2, "incorrect ui16 type"); diff --git a/util/thread/lfstack_ut.cpp b/util/thread/lfstack_ut.cpp index e20a838f95..ea012d076b 100644 --- a/util/thread/lfstack_ut.cpp +++ b/util/thread/lfstack_ut.cpp @@ -11,27 +11,27 @@ Y_UNIT_TEST_SUITE(TLockFreeStackTests) { class TCountDownLatch { private: - TAtomic Current_; - TSystemEvent EventObject_; + TAtomic Current_; + TSystemEvent EventObject_; public: TCountDownLatch(unsigned initial) - : Current_(initial) + : Current_(initial) { } void CountDown() { - if (AtomicDecrement(Current_) == 0) { - EventObject_.Signal(); + if (AtomicDecrement(Current_) == 0) { + EventObject_.Signal(); } } void Await() { - EventObject_.Wait(); + EventObject_.Wait(); } bool Await(TDuration timeout) { - return EventObject_.WaitT(timeout); + return EventObject_.WaitT(timeout); } }; |