diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/generic/xrange_ut.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/xrange_ut.cpp')
-rw-r--r-- | util/generic/xrange_ut.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/generic/xrange_ut.cpp b/util/generic/xrange_ut.cpp index 35fba4ea10..8106da03e7 100644 --- a/util/generic/xrange_ut.cpp +++ b/util/generic/xrange_ut.cpp @@ -1,8 +1,8 @@ #include "xrange.h" -#include "algorithm.h" +#include "algorithm.h" #include "maybe.h" -#include "vector.h" +#include "vector.h" #include <library/cpp/testing/unittest/registar.h> #include <util/string/builder.h> @@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(XRange) { bool firstInited = false; size_t last = 0; - for (auto i : xrange(begin, end)) { + for (auto i : xrange(begin, end)) { ++count; sum += i; last = i; @@ -32,7 +32,7 @@ Y_UNIT_TEST_SUITE(XRange) { void TestSteppedXRangeImpl(int begin, int end, int step, const TVector<int>& expected) { size_t expInd = 0; - for (auto i : xrange(begin, end, step)) { + for (auto i : xrange(begin, end, step)) { UNIT_ASSERT(expInd < expected.size()); UNIT_ASSERT_VALUES_EQUAL(i, expected[expInd]); ++expInd; @@ -68,12 +68,12 @@ Y_UNIT_TEST_SUITE(XRange) { TVector<size_t> data = {3, 1, 4, 1, 5, 9, 2, 6}; const size_t digSumExpected = Accumulate(data.begin(), data.end(), static_cast<size_t>(0)); size_t digSumByIt = 0; - for (auto ptr : xrange(data.begin(), data.end())) { + for (auto ptr : xrange(data.begin(), data.end())) { digSumByIt += *ptr; } UNIT_ASSERT_VALUES_EQUAL(digSumByIt, digSumExpected); size_t digSumByPtr = 0; - for (auto ptr : xrange(&data[0], &data[0] + data.size())) { + for (auto ptr : xrange(&data[0], &data[0] + data.size())) { digSumByPtr += *ptr; } UNIT_ASSERT_VALUES_EQUAL(digSumByPtr, digSumExpected); @@ -87,26 +87,26 @@ Y_UNIT_TEST_SUITE(XRange) { class TVectorChild: public TVector<size_t> { public: - template <typename TIterator> - TVectorChild(TIterator a, TIterator b) + template <typename TIterator> + TVectorChild(TIterator a, TIterator b) : TVector<size_t>(a, b) - { - } + { + } }; Y_UNIT_TEST(ConvertionWorks) { TVector<size_t> data = {0, 1, 2, 3, 4, 5, 6, 7, 8}; TVector<size_t> convertionResults[] = {xrange<size_t>(9), - xrange<ui32>(0, 9), - xrange(0, 9, 1)}; + xrange<ui32>(0, 9), + xrange(0, 9, 1)}; for (const auto& arr : convertionResults) { UNIT_ASSERT(arr == data); } TVectorChild sons[] = {xrange(0, 9), - xrange(0, 9, 1)}; + xrange(0, 9, 1)}; for (const auto& arr : sons) { UNIT_ASSERT(arr == data); @@ -150,7 +150,7 @@ Y_UNIT_TEST_SUITE(XRange) { xrange(5, 5, 1), xrange(5, 0, 5), xrange(0, -1, 5), - xrange(0, 1, -1), + xrange(0, 1, -1), xrange(0, -10, 10), }; |