diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:44 +0300 |
commit | 59e19371de37995fcb36beb16cd6ec030af960bc (patch) | |
tree | fa68e36093ebff8b805462e9e6d331fe9d348214 /library/cpp/on_disk | |
parent | 89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff) | |
download | ydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/on_disk')
-rw-r--r-- | library/cpp/on_disk/chunks/chunked_helpers.cpp | 2 | ||||
-rw-r--r-- | library/cpp/on_disk/chunks/chunked_helpers.h | 2 | ||||
-rw-r--r-- | library/cpp/on_disk/chunks/chunks_ut.cpp | 102 |
3 files changed, 53 insertions, 53 deletions
diff --git a/library/cpp/on_disk/chunks/chunked_helpers.cpp b/library/cpp/on_disk/chunks/chunked_helpers.cpp index b7adba2753..36ad4237d6 100644 --- a/library/cpp/on_disk/chunks/chunked_helpers.cpp +++ b/library/cpp/on_disk/chunks/chunked_helpers.cpp @@ -5,7 +5,7 @@ TBlob GetBlock(const TBlob& blob, size_t index) { TChunkedDataReader reader(blob); if (index >= reader.GetBlocksCount()) - ythrow yexception() << "index " << index << " is >= than block count " << reader.GetBlocksCount(); + ythrow yexception() << "index " << index << " is >= than block count " << reader.GetBlocksCount(); size_t begin = (const char*)reader.GetBlock(index) - (const char*)blob.Data(); return blob.SubBlob(begin, begin + reader.GetBlockLen(index)); } diff --git a/library/cpp/on_disk/chunks/chunked_helpers.h b/library/cpp/on_disk/chunks/chunked_helpers.h index 5fa96afdca..ab2da0aacd 100644 --- a/library/cpp/on_disk/chunks/chunked_helpers.h +++ b/library/cpp/on_disk/chunks/chunked_helpers.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include <util/generic/vector.h> #include <util/generic/buffer.h> diff --git a/library/cpp/on_disk/chunks/chunks_ut.cpp b/library/cpp/on_disk/chunks/chunks_ut.cpp index f727647f7f..1244ded8e1 100644 --- a/library/cpp/on_disk/chunks/chunks_ut.cpp +++ b/library/cpp/on_disk/chunks/chunks_ut.cpp @@ -53,7 +53,7 @@ public: { TBlob temp = TBlob::FromStreamSingleThreaded(stream); TPlainHash<ui64, ui16> reader(temp); - ui16 value = 0; + ui16 value = 0; UNIT_ASSERT(reader.Find(5, &value)); UNIT_ASSERT_EQUAL(7, value); UNIT_ASSERT(!reader.Find(6, &value)); @@ -202,7 +202,7 @@ public: void TestStrings() { const TString FILENAME = "chunked_helpers_test.bin"; TTempFileHandle file(FILENAME.c_str()); - + { TFixedBufferFileOutput fOut(FILENAME); TStringsVectorWriter stringsWriter; @@ -274,56 +274,56 @@ public: UNIT_TEST_SUITE_REGISTRATION(TChunkedHelpersTest); -class TChunkedDataTest: public TTestBase { -private: - UNIT_TEST_SUITE(TChunkedDataTest); +class TChunkedDataTest: public TTestBase { +private: + UNIT_TEST_SUITE(TChunkedDataTest); UNIT_TEST(Test) UNIT_TEST(TestEmpty) - UNIT_TEST_SUITE_END(); - - void Test() { - TBuffer buffer; - { - TBufferOutput out(buffer); - TChunkedDataWriter writer(out); - writer.NewBlock(); - writer << "test"; - writer.NewBlock(); - writer << 4; - writer.NewBlock(); - writer.NewBlock(); - writer << 1; - writer << 2; - writer.WriteFooter(); - } - { + UNIT_TEST_SUITE_END(); + + void Test() { + TBuffer buffer; + { + TBufferOutput out(buffer); + TChunkedDataWriter writer(out); + writer.NewBlock(); + writer << "test"; + writer.NewBlock(); + writer << 4; + writer.NewBlock(); + writer.NewBlock(); + writer << 1; + writer << 2; + writer.WriteFooter(); + } + { TBlob blob = TBlob::FromBufferSingleThreaded(buffer); - TChunkedDataReader data(blob); - // printf("%d\n", (int)data.GetBlockLen(3)); - UNIT_ASSERT_EQUAL(4, data.GetBlockLen(0)); - UNIT_ASSERT_EQUAL(1, data.GetBlockLen(1)); - UNIT_ASSERT_EQUAL(0, data.GetBlockLen(2)); - UNIT_ASSERT_EQUAL(2, data.GetBlockLen(3)); - } - } - - void TestEmpty() { - TBuffer buffer; - { - TBufferOutput out(buffer); - TChunkedDataWriter writer(out); - writer.NewBlock(); - writer.NewBlock(); - writer.WriteFooter(); - } - { + TChunkedDataReader data(blob); + // printf("%d\n", (int)data.GetBlockLen(3)); + UNIT_ASSERT_EQUAL(4, data.GetBlockLen(0)); + UNIT_ASSERT_EQUAL(1, data.GetBlockLen(1)); + UNIT_ASSERT_EQUAL(0, data.GetBlockLen(2)); + UNIT_ASSERT_EQUAL(2, data.GetBlockLen(3)); + } + } + + void TestEmpty() { + TBuffer buffer; + { + TBufferOutput out(buffer); + TChunkedDataWriter writer(out); + writer.NewBlock(); + writer.NewBlock(); + writer.WriteFooter(); + } + { TBlob blob = TBlob::FromBufferSingleThreaded(buffer); - TChunkedDataReader data(blob); - // printf("%d\n", (int)data.GetBlockLen(1)); - UNIT_ASSERT_EQUAL(0, data.GetBlockLen(0)); - UNIT_ASSERT_EQUAL(0, data.GetBlockLen(1)); - } - } -}; - -UNIT_TEST_SUITE_REGISTRATION(TChunkedDataTest); + TChunkedDataReader data(blob); + // printf("%d\n", (int)data.GetBlockLen(1)); + UNIT_ASSERT_EQUAL(0, data.GetBlockLen(0)); + UNIT_ASSERT_EQUAL(0, data.GetBlockLen(1)); + } + } +}; + +UNIT_TEST_SUITE_REGISTRATION(TChunkedDataTest); |