Lines Matching refs:queue
28 CircularQueue<int> queue(/*initial_capacity=*/1); in TEST() local
29 ASSERT_EQ(queue.size(), 0u); in TEST()
30 queue.emplace_back(101); in TEST()
31 ASSERT_EQ(queue.size(), 1u); in TEST()
32 queue.emplace_back(102); in TEST()
33 queue.emplace_back(103); in TEST()
34 queue.emplace_back(104); in TEST()
35 ASSERT_EQ(queue.size(), 4u); in TEST()
37 auto it = queue.begin(); in TEST()
42 ASSERT_EQ(it, queue.end()); in TEST()
44 queue.erase_front(1); in TEST()
45 ASSERT_EQ(queue.size(), 3u); in TEST()
46 ASSERT_EQ(*queue.begin(), 102); in TEST()
48 *(queue.begin() + 1) = 42; in TEST()
49 ASSERT_EQ(*(queue.end() - 2), 42); in TEST()
51 queue.erase_front(2); in TEST()
52 ASSERT_EQ(queue.size(), 1u); in TEST()
53 ASSERT_EQ(*queue.begin(), 104); in TEST()
55 queue.pop_front(); in TEST()
56 ASSERT_EQ(queue.size(), 0u); in TEST()
57 ASSERT_EQ(queue.begin(), queue.end()); in TEST()
65 queue.emplace_back(n); in TEST()
68 ASSERT_EQ(queue.size(), kNumInts); in TEST()
69 ASSERT_EQ(static_cast<size_t>(queue.end() - queue.begin()), kNumInts); in TEST()
72 it = queue.begin(); in TEST()
74 ASSERT_LT(it, queue.end()); in TEST()
82 while (!queue.empty()) { in TEST()
83 ASSERT_EQ(*queue.begin(), static_cast<int>(rnd_engine())); in TEST()
85 queue.erase_front(num_del + 1); // +1 because of the read 2 lines above. in TEST()
92 CircularQueue<uint64_t> queue; in TEST() local
95 queue.emplace_back(static_cast<uint64_t>(rnd_engine())); in TEST()
97 queue.erase_front(29); in TEST()
99 ASSERT_FALSE(std::is_sorted(queue.begin(), queue.end())); in TEST()
100 std::sort(queue.begin(), queue.end()); in TEST()
101 ASSERT_TRUE(std::is_sorted(queue.begin(), queue.end())); in TEST()
105 CircularQueue<int> queue; in TEST() local
106 queue.emplace_back(1); in TEST()
107 queue.emplace_back(2); in TEST()
110 CircularQueue<int> moved(std::move(queue)); in TEST()
111 ASSERT_TRUE(queue.empty()); in TEST()
118 queue.emplace_back(10); in TEST()
119 queue.emplace_back(11); in TEST()
120 queue.emplace_back(12); in TEST()
121 ASSERT_EQ(queue.size(), 3u); in TEST()
122 ASSERT_EQ(queue.front(), 10); in TEST()
123 ASSERT_EQ(queue.back(), 12); in TEST()
128 moved = std::move(queue); in TEST()
129 ASSERT_TRUE(queue.empty()); in TEST()
140 CircularQueue<size_t> queue(capacity); in TEST() local
142 queue.emplace_back(0u); in TEST()
143 queue.erase_front(queue.size()); in TEST()
144 ASSERT_TRUE(queue.empty()); in TEST()
145 ASSERT_EQ(queue.capacity(), capacity); in TEST()
151 queue.emplace_back(i); in TEST()
152 ASSERT_EQ(queue.capacity(), capacity); in TEST()
155 auto begin = queue.begin(); in TEST()
156 auto end = queue.end(); in TEST()
222 CircularQueue<Checker> queue(/*initial_capacity=*/2); in TEST() local
224 queue.emplace_back(&stats, i); in TEST()
230 queue.emplace_back(&stats, 2); in TEST()
241 CircularQueue<Checker> queue(/*initial_capacity=*/1); in TEST() local
243 queue.emplace_back(&stats, i); in TEST()
246 queue.emplace_back(std::move(c5)); in TEST()
249 queue.erase_front(2); in TEST()
253 queue.emplace_back(&stats, 10 + i); in TEST()