Lines Matching refs:q
41 ArrayQueue<int, 4> q; in TEST() local
42 EXPECT_TRUE(q.empty()); in TEST()
43 EXPECT_EQ(0, q.size()); in TEST()
47 ArrayQueue<int, 3> q; in TEST() local
48 EXPECT_TRUE(q.push(1)); in TEST()
49 EXPECT_TRUE(q.push(2)); in TEST()
50 q.pop(); in TEST()
51 EXPECT_TRUE(q.push(3)); in TEST()
55 ArrayQueue<int, 3> q; in TEST() local
56 EXPECT_TRUE(q.push(0)); in TEST()
57 EXPECT_TRUE(q.push(1)); in TEST()
58 EXPECT_TRUE(q.push(2)); in TEST()
59 q.pop_back(); in TEST()
60 EXPECT_EQ(2, q.size()); in TEST()
61 EXPECT_EQ(0, q[0]); in TEST()
62 EXPECT_EQ(1, q[1]); in TEST()
64 EXPECT_TRUE(q.push(3)); in TEST()
65 EXPECT_EQ(3, q.size()); in TEST()
66 EXPECT_EQ(0, q[0]); in TEST()
67 EXPECT_EQ(1, q[1]); in TEST()
68 EXPECT_EQ(3, q[2]); in TEST()
70 q.pop_back(); in TEST()
71 q.pop_back(); in TEST()
72 q.pop_back(); in TEST()
74 EXPECT_EQ(0, q.size()); in TEST()
75 EXPECT_TRUE(q.push(4)); in TEST()
76 EXPECT_TRUE(q.push(5)); in TEST()
77 EXPECT_TRUE(q.push(6)); in TEST()
78 EXPECT_EQ(3, q.size()); in TEST()
79 EXPECT_EQ(4, q[0]); in TEST()
80 EXPECT_EQ(5, q[1]); in TEST()
81 EXPECT_EQ(6, q[2]); in TEST()
83 q.pop(); in TEST()
85 EXPECT_TRUE(q.push(7)); in TEST()
86 EXPECT_EQ(5, q[0]); in TEST()
87 EXPECT_EQ(6, q[1]); in TEST()
88 EXPECT_EQ(7, q[2]); in TEST()
92 ArrayQueue<int, 2> q; in TEST() local
93 q.push(1); in TEST()
94 EXPECT_EQ(1, q.size()); in TEST()
95 q.push(2); in TEST()
96 EXPECT_EQ(2, q.size()); in TEST()
97 q.pop(); in TEST()
98 EXPECT_EQ(1, q.size()); in TEST()
99 q.pop(); in TEST()
103 ArrayQueue<int, 2> q; in TEST() local
104 q.push(1); in TEST()
105 EXPECT_FALSE(q.empty()); in TEST()
106 q.push(2); in TEST()
107 EXPECT_FALSE(q.empty()); in TEST()
108 q.pop(); in TEST()
109 EXPECT_FALSE(q.empty()); in TEST()
110 q.pop(); in TEST()
111 EXPECT_TRUE(q.empty()); in TEST()
115 ArrayQueue<int, 2> q; in TEST() local
116 q.kick_push(1); in TEST()
117 EXPECT_EQ(1, q.size()); in TEST()
118 EXPECT_EQ(1, q[0]); in TEST()
119 q.kick_push(2); in TEST()
120 EXPECT_EQ(2, q.size()); in TEST()
121 EXPECT_EQ(2, q[1]); in TEST()
125 ArrayQueue<int, 2> q; in TEST() local
126 q.kick_push(1); in TEST()
127 q.push(2); in TEST()
128 EXPECT_EQ(2, q.size()); in TEST()
129 q.kick_push(3); in TEST()
130 EXPECT_EQ(2, q.size()); in TEST()
131 EXPECT_EQ(2, q[0]); in TEST()
132 EXPECT_EQ(3, q[1]); in TEST()
136 ArrayQueue<int, 4> q; in TEST() local
137 q.pop(); in TEST()
138 EXPECT_EQ(0, q.size()); in TEST()
142 ArrayQueue<int, 4> q; in TEST() local
143 q.pop_back(); in TEST()
144 EXPECT_EQ(0, q.size()); in TEST()
148 ArrayQueue<int, 2> q; in TEST() local
149 q.push(1); in TEST()
150 q.push(2); in TEST()
151 EXPECT_FALSE(q.push(3)); in TEST()
155 ArrayQueue<int, 4> q; in TEST() local
156 EXPECT_DEATH(q.front(), ""); in TEST()
160 ArrayQueue<int, 4> q; in TEST() local
161 EXPECT_DEATH(q.back(), ""); in TEST()
165 ArrayQueue<int, 3> q; in TEST() local
166 q.push(1); in TEST()
167 EXPECT_EQ(1, q.front()); in TEST()
168 q.pop(); in TEST()
169 q.push(2); in TEST()
170 EXPECT_EQ(2, q.front()); in TEST()
171 q.push(3); in TEST()
172 EXPECT_EQ(2, q.front()); in TEST()
176 ArrayQueue<int, 3> q; in TEST() local
177 q.push(1); in TEST()
178 EXPECT_EQ(1, q.back()); in TEST()
179 q.pop(); in TEST()
180 q.push(2); in TEST()
181 EXPECT_EQ(2, q.back()); in TEST()
182 q.push(3); in TEST()
183 EXPECT_EQ(3, q.back()); in TEST()
187 ArrayQueue<int, 2> q; in TEST() local
188 EXPECT_DEATH(q[0], ""); in TEST()
192 ArrayQueue<int, 2> q; in TEST() local
193 q.push(1); in TEST()
194 q.push(2); in TEST()
195 EXPECT_EQ(1, q[0]); in TEST()
196 EXPECT_EQ(2, q[1]); in TEST()
197 q.pop(); in TEST()
198 EXPECT_EQ(2, q[0]); in TEST()
202 ArrayQueue<int, 3> q; in TEST() local
203 EXPECT_FALSE(q.remove(0)); in TEST()
207 ArrayQueue<int, 3> q; in TEST() local
208 q.push(1); in TEST()
209 q.push(2); in TEST()
210 q.remove(0); in TEST()
211 EXPECT_EQ(2, q.front()); in TEST()
212 EXPECT_EQ(1, q.size()); in TEST()
213 q.push(3); in TEST()
214 q.remove(1); in TEST()
215 EXPECT_EQ(2, q.front()); in TEST()
216 EXPECT_EQ(1, q.size()); in TEST()
224 ArrayQueue<FakeElement, 3> q; in TEST() local
226 q.push(e); in TEST()
227 q.push(e); in TEST()
229 q.front().setValue(0); in TEST()
230 q.pop(); in TEST()
233 q.front().setValue(1); in TEST()
234 q.pop(); in TEST()
246 ArrayQueue<FakeElement, 4> q; in TEST() local
250 q.push(e); in TEST()
251 q[i].setValue(i); in TEST()
254 q.~ArrayQueue(); in TEST()
271 ArrayQueue<FakeElement, 2> q; in TEST() local
273 EXPECT_TRUE(q.emplace(0)); in TEST()
275 EXPECT_EQ(1, q.size()); in TEST()
277 EXPECT_TRUE(q.emplace(1)); in TEST()
279 EXPECT_EQ(2, q.size()); in TEST()
281 EXPECT_FALSE(q.emplace(2)); in TEST()
283 EXPECT_EQ(2, q.size()); in TEST()
287 ArrayQueue<int, 4> q; in TEST() local
289 ArrayQueue<int, 4>::iterator it = q.begin(); in TEST()
290 EXPECT_TRUE(it == q.end()); in TEST()
291 EXPECT_FALSE(it != q.end()); in TEST()
295 ArrayQueue<int, 4> q; in TEST() local
297 q.push(i); in TEST()
299 EXPECT_NE(q.begin(), q.end()); in TEST()
302 for (ArrayQueue<int, 4>::iterator it = q.begin(); it != q.end(); ++it) { in TEST()
303 EXPECT_EQ(q[index++], *it); in TEST()
306 for (ArrayQueue<int, 4>::iterator it = q.begin(); it != q.end(); it++) { in TEST()
307 EXPECT_EQ(q[index++], *it); in TEST()
311 ArrayQueue<int, 4>::iterator it = q.begin(); in TEST()
312 while (it != q.end()) { in TEST()
313 EXPECT_EQ(q[index++], *it++); in TEST()
317 q.pop(); in TEST()
318 q.push(i + 3); in TEST()
322 it = q.begin(); in TEST()
323 while (it != q.end()) { in TEST()
324 EXPECT_EQ(q[index++], *it++); in TEST()
338 ArrayQueue<int, 2> q; in TEST() local
339 q.push(1); in TEST()
340 q.push(2); in TEST()
342 auto it1 = q.begin(), it2 = q.end(); in TEST()
344 EXPECT_EQ(it1, q.end()); in TEST()
345 EXPECT_EQ(it2, q.begin()); in TEST()
349 ArrayQueue<int, 4> q; in TEST() local
351 q.push(i); in TEST()
354 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
355 ArrayQueue<int, 4>::iterator it_e = q.end(); in TEST()
356 q.push(3); in TEST()
360 EXPECT_EQ(q[index++], *it_b++); in TEST()
365 ArrayQueue<int, 4> q; in TEST() local
367 q.push(i); in TEST()
370 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
371 q.pop(); in TEST()
375 EXPECT_EQ(q[i], *it_b++); in TEST()
380 ArrayQueue<int, 4> q; in TEST() local
382 q.push(i); in TEST()
385 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
386 q.remove(1); in TEST()
388 EXPECT_EQ(q[0], *it_b); in TEST()
392 ArrayQueue<int, 4> q; in TEST() local
394 q.push(i); in TEST()
397 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
398 ArrayQueue<int, 4>::iterator it_e = q.end(); in TEST()
399 q.emplace(3); in TEST()
403 EXPECT_EQ(q[index++], *it_b++); in TEST()
408 ArrayQueue<int, 4> q; in TEST() local
410 q.push(i); in TEST()
414 for (ArrayQueue<int, 4>::const_iterator cit = q.cbegin(); cit != q.cend(); in TEST()
416 EXPECT_EQ(q[index++], *cit); in TEST()
420 ArrayQueue<int, 4>::const_iterator cit = q.cbegin(); in TEST()
421 while (cit != q.cend()) { in TEST()
422 EXPECT_EQ(q[index++], *cit++); in TEST()
426 q.pop(); in TEST()
427 q.push(i + 3); in TEST()
431 cit = q.cbegin(); in TEST()
432 while (cit != q.cend()) { in TEST()
433 EXPECT_EQ(q[index++], *cit++); in TEST()
438 ArrayQueue<size_t, 4> q; in TEST() local
440 EXPECT_FALSE(q.full()); in TEST()
441 q.push(i); in TEST()
444 EXPECT_TRUE(q.full()); in TEST()
449 ArrayQueue<size_t, kSize> q; in TEST() local
454 q.push(i); in TEST()
457 std::copy(q.begin(), q.end(), v.begin()); in TEST()
460 EXPECT_EQ(q[j], v[j]); in TEST()
461 EXPECT_EQ(*std::next(q.begin(), j), v[j]); in TEST()
467 ArrayQueue<int, 2> q; in TEST() local
468 q.push(1234); in TEST()
469 q.push(5678); in TEST()
471 using traits = std::iterator_traits<decltype(q)::iterator>; in TEST()
472 typename traits::difference_type diff = std::distance(q.begin(), q.end()); in TEST()
473 EXPECT_EQ(diff, q.size()); in TEST()
475 typename traits::value_type v = *q.begin(); in TEST()
476 EXPECT_EQ(v, q[0]); in TEST()
478 typename traits::reference r = *q.begin(); in TEST()
480 EXPECT_EQ(r, q[0]); in TEST()
483 EXPECT_EQ(*p, q[0]); in TEST()
494 ArrayQueue<size_t, 4> q; in TEST() local
496 q.clear(); in TEST()
497 EXPECT_TRUE(q.empty()); in TEST()
500 q.push(i); in TEST()
503 q.clear(); in TEST()
504 EXPECT_TRUE(q.empty()); in TEST()
508 q.push(i); in TEST()
511 EXPECT_EQ(q[i], i); in TEST()
521 ArrayQueue<FakeElement, 4> q; in TEST() local
523 q.emplace(i); in TEST()
526 q.clear(); in TEST()