diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/packers | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/packers')
-rw-r--r-- | library/cpp/packers/packers.h | 22 | ||||
-rw-r--r-- | library/cpp/packers/ut/packers_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/packers/ut/proto_packer_ut.cpp | 10 | ||||
-rw-r--r-- | library/cpp/packers/ut/region_packer_ut.cpp | 6 |
4 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/packers/packers.h b/library/cpp/packers/packers.h index 1bde1b59aa..2e06a0d833 100644 --- a/library/cpp/packers/packers.h +++ b/library/cpp/packers/packers.h @@ -5,7 +5,7 @@ #include <util/generic/set.h> #include <util/generic/list.h> #include <util/generic/vector.h> -#include <util/generic/bitops.h> +#include <util/generic/bitops.h> #include <array> // Data serialization strategy class. @@ -37,11 +37,11 @@ public: memcpy(&t, p, sizeof(T)); } void PackLeaf(char* buffer, const T& data, size_t computedSize) const { - Y_ASSERT(computedSize == sizeof(data)); + Y_ASSERT(computedSize == sizeof(data)); memcpy(buffer, &data, sizeof(T)); } size_t MeasureLeaf(const T& data) const { - Y_UNUSED(data); + Y_UNUSED(data); return sizeof(T); } size_t SkipLeaf(const char*) const { @@ -211,14 +211,14 @@ namespace NPackers { TFloat FromUInt(TUInt u) const { THelper h; - h.U = ReverseBytes(u); + h.U = ReverseBytes(u); return h.F; } TUInt ToUInt(TFloat f) const { THelper h; h.F = f; - return ReverseBytes(h.U); + return ReverseBytes(h.U); } public: @@ -416,7 +416,7 @@ namespace NPackers { TElementPacker().PackLeaf(buffer + curSize, *p, sizeChange); curSize += sizeChange; } - Y_ASSERT(curSize == size); + Y_ASSERT(curSize == size); } template <class C, class EP> @@ -430,7 +430,7 @@ namespace NPackers { // e.g. when curSize is 127 and stays in one byte, but curSize + 1 requires two bytes. extraSize = TIntegralPacker<size_t>().MeasureLeaf(curSize + extraSize); - Y_ASSERT(extraSize == TIntegralPacker<size_t>().MeasureLeaf(curSize + extraSize)); + Y_ASSERT(extraSize == TIntegralPacker<size_t>().MeasureLeaf(curSize + extraSize)); return curSize + extraSize; } @@ -469,7 +469,7 @@ namespace NPackers { TPacker1().PackLeaf(buffer, data.first, size1); size_t size2 = TPacker2().MeasureLeaf(data.second); TPacker2().PackLeaf(buffer + size1, data.second, size2); - Y_ASSERT(size == size1 + size2); + Y_ASSERT(size == size1 + size2); } template <class T1, class T2, class TPacker1, class TPacker2> @@ -600,12 +600,12 @@ namespace NPackers { class TPacker<TSet<T>>: public TContainerPacker<TSet<T>> { }; - template <class T1, class T2> + template <class T1, class T2> class TPacker<std::pair<T1, T2>>: public TPairPacker<T1, T2> { }; - template <class T, size_t N> + template <class T, size_t N> class TPacker<std::array<T, N>>: public TArrayPacker<std::array<T, N>> { - }; + }; } diff --git a/library/cpp/packers/ut/packers_ut.cpp b/library/cpp/packers/ut/packers_ut.cpp index 18ce2150d1..9318782f80 100644 --- a/library/cpp/packers/ut/packers_ut.cpp +++ b/library/cpp/packers/ut/packers_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <util/stream/output.h> +#include <util/stream/output.h> #include <utility> #include <util/charset/wide.h> @@ -75,7 +75,7 @@ void TPackersTest::TestPackers() { TestPacker<TString, NPackers::TPacker<TString>>(test, Y_ARRAY_SIZE(test)); - for (size_t i = 0; i != Y_ARRAY_SIZE(test); ++i) { + for (size_t i = 0; i != Y_ARRAY_SIZE(test); ++i) { TestPacker<TUtf16String, NPackers::TPacker<TUtf16String>>(UTF8ToWide(test[i])); } } diff --git a/library/cpp/packers/ut/proto_packer_ut.cpp b/library/cpp/packers/ut/proto_packer_ut.cpp index e4151ba68c..a89d6a74a0 100644 --- a/library/cpp/packers/ut/proto_packer_ut.cpp +++ b/library/cpp/packers/ut/proto_packer_ut.cpp @@ -45,7 +45,7 @@ bool operator==(const TTestMessage& lhs, const TTestMessage& rhs) { return true; } -Y_UNIT_TEST_SUITE(ProtoPackerTestSuite) { +Y_UNIT_TEST_SUITE(ProtoPackerTestSuite) { TProtoMessagePacker<TTestMessage> Packer; TString Buffer; @@ -61,20 +61,20 @@ Y_UNIT_TEST_SUITE(ProtoPackerTestSuite) { UNIT_ASSERT_EQUAL(msg, checkMsg); } - Y_UNIT_TEST(TestPackUnpackOnlyRequired) { + Y_UNIT_TEST(TestPackUnpackOnlyRequired) { TTestMessage msg; FillRequiredFields(msg); DoPackUnpackTest(msg); } - Y_UNIT_TEST(TestPackUnpackRequiredAndOptional) { + Y_UNIT_TEST(TestPackUnpackRequiredAndOptional) { TTestMessage msg; FillRequiredFields(msg); FillOptionalFields(msg); DoPackUnpackTest(msg); } - Y_UNIT_TEST(TestPackUnpackAll) { + Y_UNIT_TEST(TestPackUnpackAll) { TTestMessage msg; FillRequiredFields(msg); FillOptionalFields(msg); @@ -82,7 +82,7 @@ Y_UNIT_TEST_SUITE(ProtoPackerTestSuite) { DoPackUnpackTest(msg); } - Y_UNIT_TEST(TestSkipLeaf) { + Y_UNIT_TEST(TestSkipLeaf) { TTestMessage msgFirst; FillRequiredFields(msgFirst); TTestMessage msgSecond; diff --git a/library/cpp/packers/ut/region_packer_ut.cpp b/library/cpp/packers/ut/region_packer_ut.cpp index 0cb08ccf65..1d71d40941 100644 --- a/library/cpp/packers/ut/region_packer_ut.cpp +++ b/library/cpp/packers/ut/region_packer_ut.cpp @@ -9,7 +9,7 @@ void TestPacker() { TRegionPacker<TValue> p; using TValues = TArrayRef<TValue>; - TValues valueRegion = TValues(values, Y_ARRAY_SIZE(values)); + TValues valueRegion = TValues(values, Y_ARRAY_SIZE(values)); size_t sz = p.MeasureLeaf(valueRegion); UNIT_ASSERT_VALUES_EQUAL(sz, 1 + sizeof(values)); @@ -23,8 +23,8 @@ void TestPacker() { UNIT_ASSERT_EQUAL(0, memcmp(values, valueRegion.data(), sizeof(values))); } -Y_UNIT_TEST_SUITE(RegionPacker) { - Y_UNIT_TEST(Test0) { +Y_UNIT_TEST_SUITE(RegionPacker) { + Y_UNIT_TEST(Test0) { TestPacker<char>(); TestPacker<signed char>(); TestPacker<unsigned char>(); |