diff options
author | Ivan Komarov <Ivan.Komarov@dfyz.info> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 4de97ab2fe437cbe83e4c63234e809ddd5ac34f2 (patch) | |
tree | ff8fb38b661955e6c99d1d000d6c72f739199590 /library/cpp/containers/bitseq/bitvector_ut.cpp | |
parent | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (diff) | |
download | ydb-4de97ab2fe437cbe83e4c63234e809ddd5ac34f2.tar.gz |
Restoring authorship annotation for Ivan Komarov <Ivan.Komarov@dfyz.info>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/bitseq/bitvector_ut.cpp')
-rw-r--r-- | library/cpp/containers/bitseq/bitvector_ut.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/cpp/containers/bitseq/bitvector_ut.cpp b/library/cpp/containers/bitseq/bitvector_ut.cpp index 6137adab1e..3ba2791354 100644 --- a/library/cpp/containers/bitseq/bitvector_ut.cpp +++ b/library/cpp/containers/bitseq/bitvector_ut.cpp @@ -1,11 +1,11 @@ #include "bitvector.h" -#include "readonly_bitvector.h" +#include "readonly_bitvector.h" #include <library/cpp/testing/unittest/registar.h> -#include <util/memory/blob.h> -#include <util/stream/buffer.h> - +#include <util/memory/blob.h> +#include <util/stream/buffer.h> + Y_UNIT_TEST_SUITE(TBitVectorTest) { Y_UNIT_TEST(TestEmpty) { TBitVector<ui64> v64; @@ -66,21 +66,21 @@ Y_UNIT_TEST_SUITE(TBitVectorTest) { v.Set(10 * 32, 100500, 32); UNIT_ASSERT_EQUAL(v.Get(10 * 32, 32), 100500); } - + Y_UNIT_TEST(TestReadonlyVector) { - TBitVector<ui64> v(100); - for (ui64 i = 0; i < v.Size(); ++i) { - if (i % 3 == 0) { - v.Set(i); - } - } - TBufferStream bs; - TReadonlyBitVector<ui64>::SaveForReadonlyAccess(&bs, v); - const auto blob = TBlob::FromBuffer(bs.Buffer()); - TReadonlyBitVector<ui64> rv; - rv.LoadFromBlob(blob); - for (ui64 i = 0; i < rv.Size(); ++i) { - UNIT_ASSERT_VALUES_EQUAL(rv.Test(i), i % 3 == 0); - } - } + TBitVector<ui64> v(100); + for (ui64 i = 0; i < v.Size(); ++i) { + if (i % 3 == 0) { + v.Set(i); + } + } + TBufferStream bs; + TReadonlyBitVector<ui64>::SaveForReadonlyAccess(&bs, v); + const auto blob = TBlob::FromBuffer(bs.Buffer()); + TReadonlyBitVector<ui64> rv; + rv.LoadFromBlob(blob); + for (ui64 i = 0; i < rv.Size(); ++i) { + UNIT_ASSERT_VALUES_EQUAL(rv.Test(i), i % 3 == 0); + } + } } |