diff options
author | iroubin <iroubin@yandex-team.ru> | 2022-02-10 16:52:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:52:05 +0300 |
commit | e1eef5fd2ea964227b9be2c182415857c35e1290 (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb /util/generic/deque_ut.cpp | |
parent | 94a4c65975048c0c31313b5105d9eb14cbde4985 (diff) | |
download | ydb-e1eef5fd2ea964227b9be2c182415857c35e1290.tar.gz |
Restoring authorship annotation for <iroubin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/deque_ut.cpp')
-rw-r--r-- | util/generic/deque_ut.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/util/generic/deque_ut.cpp b/util/generic/deque_ut.cpp index b363bfa361..93bf50fa92 100644 --- a/util/generic/deque_ut.cpp +++ b/util/generic/deque_ut.cpp @@ -26,45 +26,45 @@ protected: UNIT_TEST_SUITE_REGISTRATION(TDequeTest); -void TDequeTest::TestConstructorsAndAssignments() { +void TDequeTest::TestConstructorsAndAssignments() { using container = TDeque<int>; - - container c1; - c1.push_back(100); - c1.push_back(200); - - container c2(c1); - - UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); - UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); - UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0)); - UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1)); - + + container c1; + c1.push_back(100); + c1.push_back(200); + + container c2(c1); + + UNIT_ASSERT_VALUES_EQUAL(2, c1.size()); + UNIT_ASSERT_VALUES_EQUAL(2, c2.size()); + UNIT_ASSERT_VALUES_EQUAL(100, c1.at(0)); + UNIT_ASSERT_VALUES_EQUAL(200, c2.at(1)); + container c3(std::move(c1)); - - UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); - UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); - UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0)); - - c2.push_back(300); - c3 = c2; - - UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); - UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); - UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2)); - - c2.push_back(400); + + UNIT_ASSERT_VALUES_EQUAL(0, c1.size()); + UNIT_ASSERT_VALUES_EQUAL(2, c3.size()); + UNIT_ASSERT_VALUES_EQUAL(100, c3.at(0)); + + c2.push_back(300); + c3 = c2; + + UNIT_ASSERT_VALUES_EQUAL(3, c2.size()); + UNIT_ASSERT_VALUES_EQUAL(3, c3.size()); + UNIT_ASSERT_VALUES_EQUAL(300, c3.at(2)); + + c2.push_back(400); c3 = std::move(c2); - - UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); - UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); - UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3)); + + UNIT_ASSERT_VALUES_EQUAL(0, c2.size()); + UNIT_ASSERT_VALUES_EQUAL(4, c3.size()); + UNIT_ASSERT_VALUES_EQUAL(400, c3.at(3)); int array[] = {2, 3, 4}; container c4 = {2, 3, 4}; UNIT_ASSERT_VALUES_EQUAL(c4, container(std::begin(array), std::end(array))); -} - +} + void TDequeTest::TestDeque1() { TDeque<int> d; UNIT_ASSERT(!d); |