diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/generic/queue_ut.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/queue_ut.cpp')
-rw-r--r-- | util/generic/queue_ut.cpp | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/util/generic/queue_ut.cpp b/util/generic/queue_ut.cpp index a33399e104..b51bc607d4 100644 --- a/util/generic/queue_ut.cpp +++ b/util/generic/queue_ut.cpp @@ -1,9 +1,9 @@ -#include "queue.h" -#include "list.h" -#include "vector.h" - +#include "queue.h" +#include "list.h" +#include "vector.h" + #include <library/cpp/testing/unittest/registar.h> - + #include <utility> Y_UNIT_TEST_SUITE(TYQueueTest) { @@ -75,59 +75,59 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { Y_UNIT_TEST(pqueue1) { TPriorityQueue<int, TDeque<int>, TLess<int>> q; - - q.push(42); - q.push(101); - q.push(69); - UNIT_ASSERT(q.top() == 101); - - q.pop(); - UNIT_ASSERT(q.top() == 69); - - q.pop(); - UNIT_ASSERT(q.top() == 42); - - q.pop(); - UNIT_ASSERT(q.empty()); - } - + + q.push(42); + q.push(101); + q.push(69); + UNIT_ASSERT(q.top() == 101); + + q.pop(); + UNIT_ASSERT(q.top() == 69); + + q.pop(); + UNIT_ASSERT(q.top() == 42); + + q.pop(); + UNIT_ASSERT(q.empty()); + } + Y_UNIT_TEST(pqueue2) { using TPQueue = TPriorityQueue<int, TDeque<int>, TLess<int>>; - TPQueue q; - - { - TPQueue qq; - - qq.push(42); - qq.push(101); - qq.push(69); - - qq.swap(q); - } - - UNIT_ASSERT(q.top() == 101); - - q.pop(); - UNIT_ASSERT(q.top() == 69); - - q.pop(); - UNIT_ASSERT(q.top() == 42); - - q.pop(); - UNIT_ASSERT(q.empty()); - } - + TPQueue q; + + { + TPQueue qq; + + qq.push(42); + qq.push(101); + qq.push(69); + + qq.swap(q); + } + + UNIT_ASSERT(q.top() == 101); + + q.pop(); + UNIT_ASSERT(q.top() == 69); + + q.pop(); + UNIT_ASSERT(q.top() == 42); + + q.pop(); + UNIT_ASSERT(q.empty()); + } + Y_UNIT_TEST(pqueue3) { TPriorityQueue<int, TDeque<int>, TLess<int>> q; - - q.push(42); - q.push(101); - q.push(69); - q.clear(); - - UNIT_ASSERT(q.empty()); - } - + + q.push(42); + q.push(101); + q.push(69); + q.clear(); + + UNIT_ASSERT(q.empty()); + } + Y_UNIT_TEST(pqueue4) { TDeque<int> c; c.push_back(42); @@ -154,57 +154,57 @@ Y_UNIT_TEST_SUITE(TYQueueTest) { Y_UNIT_TEST(queue1) { TQueue<int, TList<int>> q; - - q.push(42); - q.push(101); - q.push(69); - UNIT_ASSERT(q.front() == 42); - - q.pop(); - UNIT_ASSERT(q.front() == 101); - - q.pop(); - UNIT_ASSERT(q.front() == 69); - - q.pop(); - UNIT_ASSERT(q.empty()); - } - + + q.push(42); + q.push(101); + q.push(69); + UNIT_ASSERT(q.front() == 42); + + q.pop(); + UNIT_ASSERT(q.front() == 101); + + q.pop(); + UNIT_ASSERT(q.front() == 69); + + q.pop(); + UNIT_ASSERT(q.empty()); + } + Y_UNIT_TEST(queue2) { using TQueueType = TQueue<int>; TQueueType q; - - { + + { TQueueType qq; - - qq.push(42); - qq.push(101); - qq.push(69); - - qq.swap(q); - } - - UNIT_ASSERT(q.front() == 42); - - q.pop(); - UNIT_ASSERT(q.front() == 101); - - q.pop(); - UNIT_ASSERT(q.front() == 69); - - q.pop(); - UNIT_ASSERT(q.empty()); - } - + + qq.push(42); + qq.push(101); + qq.push(69); + + qq.swap(q); + } + + UNIT_ASSERT(q.front() == 42); + + q.pop(); + UNIT_ASSERT(q.front() == 101); + + q.pop(); + UNIT_ASSERT(q.front() == 69); + + q.pop(); + UNIT_ASSERT(q.empty()); + } + Y_UNIT_TEST(queue3) { using TQueueType = TQueue<int>; TQueueType q; - - q.push(42); - q.push(101); - q.push(69); - q.clear(); - - UNIT_ASSERT(q.empty()); - } -} + + q.push(42); + q.push(101); + q.push(69); + q.clear(); + + UNIT_ASSERT(q.empty()); + } +} |