aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/queue_ut.cpp
diff options
context:
space:
mode:
authoriroubin <iroubin@yandex-team.ru>2022-02-10 16:52:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:52:05 +0300
commit94a4c65975048c0c31313b5105d9eb14cbde4985 (patch)
tree10d8bff3d82a2ded7c507fbc2f27eebf8eccc4b7 /util/generic/queue_ut.cpp
parent774bb09ec81216d51cb063ed9af52ddbc712ab20 (diff)
downloadydb-94a4c65975048c0c31313b5105d9eb14cbde4985.tar.gz
Restoring authorship annotation for <iroubin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/queue_ut.cpp')
-rw-r--r--util/generic/queue_ut.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/util/generic/queue_ut.cpp b/util/generic/queue_ut.cpp
index a33399e104..c23e6acbee 100644
--- a/util/generic/queue_ut.cpp
+++ b/util/generic/queue_ut.cpp
@@ -5,74 +5,74 @@
#include <library/cpp/testing/unittest/registar.h>
#include <utility>
-
+
Y_UNIT_TEST_SUITE(TYQueueTest) {
Y_UNIT_TEST(ConstructorsAndAssignments) {
- {
+ {
using container = TQueue<int>;
-
- container c1;
+
+ container c1;
UNIT_ASSERT(!c1);
- c1.push(100);
- c1.push(200);
+ c1.push(100);
+ c1.push(200);
UNIT_ASSERT(c1);
-
- container c2(c1);
-
- UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
- UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-
+
+ container c2(c1);
+
+ UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
+ UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
+
container c3(std::move(c1));
-
- UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
- UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-
- c2.push(300);
- c3 = c2;
-
- UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
- UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-
- c2.push(400);
+
+ UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
+ UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
+
+ c2.push(300);
+ c3 = c2;
+
+ UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
+ UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
+
+ c2.push(400);
c3 = std::move(c2);
-
- UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
- UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
- }
-
- {
+
+ UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
+ UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
+ }
+
+ {
using container = TPriorityQueue<int>;
-
- container c1;
+
+ container c1;
UNIT_ASSERT(!c1);
- c1.push(100);
- c1.push(200);
+ c1.push(100);
+ c1.push(200);
UNIT_ASSERT(c1);
-
- container c2(c1);
-
- UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
- UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
-
+
+ container c2(c1);
+
+ UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
+ UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
+
container c3(std::move(c1));
-
- UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
- UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
-
- c2.push(300);
- c3 = c2;
-
- UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
- UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
-
- c2.push(400);
+
+ UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
+ UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
+
+ c2.push(300);
+ c3 = c2;
+
+ UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
+ UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
+
+ c2.push(400);
c3 = std::move(c2);
-
- UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
- UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
- }
- }
-
+
+ UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
+ UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
+ }
+ }
+
Y_UNIT_TEST(pqueue1) {
TPriorityQueue<int, TDeque<int>, TLess<int>> q;