• Home
  • Raw
  • Download

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<DummyElement, 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()
245 { ArrayQueue<DummyElement, 4> q; in TEST() local
249 q.push(e); in TEST()
250 q[i].setValue(i); in TEST()
253 q.~ArrayQueue(); in TEST()
270 ArrayQueue<DummyElement, 2> q; in TEST() local
272 EXPECT_TRUE(q.emplace(0)); in TEST()
274 EXPECT_EQ(1, q.size()); in TEST()
276 EXPECT_TRUE(q.emplace(1)); in TEST()
278 EXPECT_EQ(2, q.size()); in TEST()
280 EXPECT_FALSE(q.emplace(2)); in TEST()
282 EXPECT_EQ(2, q.size()); in TEST()
286 ArrayQueue<int, 4> q; in TEST() local
288 ArrayQueue<int, 4>::iterator it = q.begin(); in TEST()
289 EXPECT_TRUE(it == q.end()); in TEST()
290 EXPECT_FALSE(it != q.end()); in TEST()
294 ArrayQueue<int, 4> q; in TEST() local
296 q.push(i); in TEST()
298 EXPECT_NE(q.begin(), q.end()); in TEST()
301 for (ArrayQueue<int, 4>::iterator it = q.begin(); it != q.end(); ++it) { in TEST()
302 EXPECT_EQ(q[index++], *it); in TEST()
305 for (ArrayQueue<int, 4>::iterator it = q.begin(); it != q.end(); it++) { in TEST()
306 EXPECT_EQ(q[index++], *it); in TEST()
310 ArrayQueue<int, 4>::iterator it = q.begin(); in TEST()
311 while (it != q.end()) { in TEST()
312 EXPECT_EQ(q[index++], *it++); in TEST()
316 q.pop(); in TEST()
317 q.push(i + 3); in TEST()
321 it = q.begin(); in TEST()
322 while (it != q.end()) { in TEST()
323 EXPECT_EQ(q[index++], *it++); in TEST()
337 ArrayQueue<int, 2> q; in TEST() local
338 q.push(1); in TEST()
339 q.push(2); in TEST()
341 auto it1 = q.begin(), it2 = q.end(); in TEST()
343 EXPECT_EQ(it1, q.end()); in TEST()
344 EXPECT_EQ(it2, q.begin()); in TEST()
348 ArrayQueue<int, 4> q; in TEST() local
350 q.push(i); in TEST()
353 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
354 ArrayQueue<int, 4>::iterator it_e = q.end(); in TEST()
355 q.push(3); in TEST()
359 EXPECT_EQ(q[index++], *it_b++); in TEST()
364 ArrayQueue<int, 4> q; in TEST() local
366 q.push(i); in TEST()
369 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
370 q.pop(); in TEST()
374 EXPECT_EQ(q[i], *it_b++); in TEST()
379 ArrayQueue<int, 4> q; in TEST() local
381 q.push(i); in TEST()
384 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
385 q.remove(1); in TEST()
387 EXPECT_EQ(q[0], *it_b); in TEST()
391 ArrayQueue<int, 4> q; in TEST() local
393 q.push(i); in TEST()
396 ArrayQueue<int, 4>::iterator it_b = q.begin(); in TEST()
397 ArrayQueue<int, 4>::iterator it_e = q.end(); in TEST()
398 q.emplace(3); in TEST()
402 EXPECT_EQ(q[index++], *it_b++); in TEST()
407 ArrayQueue<int, 4> q; in TEST() local
409 q.push(i); in TEST()
413 for (ArrayQueue<int, 4>::const_iterator cit = q.cbegin(); in TEST()
414 cit != q.cend(); ++cit) { in TEST()
415 EXPECT_EQ(q[index++], *cit); in TEST()
419 ArrayQueue<int, 4>::const_iterator cit = q.cbegin(); in TEST()
420 while (cit != q.cend()) { in TEST()
421 EXPECT_EQ(q[index++], *cit++); in TEST()
425 q.pop(); in TEST()
426 q.push(i + 3); in TEST()
430 cit = q.cbegin(); in TEST()
431 while (cit != q.cend()) { in TEST()
432 EXPECT_EQ(q[index++], *cit++); in TEST()
437 ArrayQueue<size_t, 4> q; in TEST() local
439 EXPECT_FALSE(q.full()); in TEST()
440 q.push(i); in TEST()
443 EXPECT_TRUE(q.full()); in TEST()
448 ArrayQueue<size_t, kSize> q; in TEST() local
453 q.push(i); in TEST()
456 std::copy(q.begin(), q.end(), v.begin()); in TEST()
459 EXPECT_EQ(q[j], v[j]); in TEST()
460 EXPECT_EQ(*std::next(q.begin(), j), v[j]); in TEST()
466 ArrayQueue<int, 2> q; in TEST() local
467 q.push(1234); in TEST()
468 q.push(5678); in TEST()
470 using traits = std::iterator_traits<decltype(q)::iterator>; in TEST()
471 typename traits::difference_type diff = std::distance(q.begin(), q.end()); in TEST()
472 EXPECT_EQ(diff, q.size()); in TEST()
474 typename traits::value_type v = *q.begin(); in TEST()
475 EXPECT_EQ(v, q[0]); in TEST()
477 typename traits::reference r = *q.begin(); in TEST()
479 EXPECT_EQ(r, q[0]); in TEST()
482 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<DummyElement, 4> q; in TEST() local
523 q.emplace(i); in TEST()
526 q.clear(); in TEST()