diff options
author | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-02-10 16:49:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:15 +0300 |
commit | 1c61afbf3db63940d05e6fefa3104b03457788a1 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic | |
parent | e542cc14db4240643a06bb0dde87ecf361f101ab (diff) | |
download | ydb-1c61afbf3db63940d05e6fefa3104b03457788a1.tar.gz |
Restoring authorship annotation for Andrey Fomichev <andrey.fomichev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r-- | util/generic/buffer.h | 4 | ||||
-rw-r--r-- | util/generic/buffer_ut.cpp | 38 |
2 files changed, 21 insertions, 21 deletions
diff --git a/util/generic/buffer.h b/util/generic/buffer.h index 9cfebdf009..9576467404 100644 --- a/util/generic/buffer.h +++ b/util/generic/buffer.h @@ -49,7 +49,7 @@ public: inline void Reset() noexcept { TBuffer().Swap(*this); } - + inline void Assign(const char* data, size_t len) { Clear(); Append(data, len); @@ -180,7 +180,7 @@ public: Append(fillChar); } } - + inline char* data() noexcept { return Data(); } diff --git a/util/generic/buffer_ut.cpp b/util/generic/buffer_ut.cpp index 5922636b4b..437d7122ec 100644 --- a/util/generic/buffer_ut.cpp +++ b/util/generic/buffer_ut.cpp @@ -41,19 +41,19 @@ Y_UNIT_TEST_SUITE(TBufferTest) { buf.Append(content, sizeof(content)); buf.Clear(); - + UNIT_ASSERT(buf.Capacity() != 0); - + buf.Append(content, sizeof(content)); buf.Reset(); - + UNIT_ASSERT_EQUAL(buf.Capacity(), 0); } - + Y_UNIT_TEST(TestResize) { char content[] = "some text"; TBuffer buf; - + buf.Resize(10); UNIT_ASSERT_VALUES_EQUAL(buf.size(), 10u); @@ -127,23 +127,23 @@ Y_UNIT_TEST_SUITE(TBufferTest) { #if 0 Y_UNIT_TEST(TestAlignUp) { - char content[] = "some text"; - TBuffer buf; - - buf.Append(content, sizeof(content)); - buf.AlignUp(4, '!'); - - UNIT_ASSERT(buf.Size() % 4 == 0); + char content[] = "some text"; + TBuffer buf; + + buf.Append(content, sizeof(content)); + buf.AlignUp(4, '!'); + + UNIT_ASSERT(buf.Size() % 4 == 0); UNIT_ASSERT_VALUES_EQUAL(TString(~buf, +buf), "some text!!!"); - - char addContent[] = "1234"; - buf.Append(addContent, sizeof(addContent)); - buf.AlignUp(4, 'X'); - UNIT_ASSERT(buf.Size() % 4 == 0); + + char addContent[] = "1234"; + buf.Append(addContent, sizeof(addContent)); + buf.AlignUp(4, 'X'); + UNIT_ASSERT(buf.Size() % 4 == 0); UNIT_ASSERT_VALUES_EQUAL(TString(~buf, +buf), "some text!!!1234"); -} +} #endif - + #if 0 Y_UNIT_TEST(TestSpeed) { const char data[] = "1234567890qwertyuiop"; |