Lines Matching refs:queue
33 BlockingQueue<int> queue(capacity); in TEST() local
35 ASSERT_TRUE(queue.push(1)); in TEST()
36 ASSERT_EQ(queue.pop(), 1); in TEST()
44 BlockingQueue<int> queue(capacity); in TEST() local
47 ASSERT_TRUE(queue.push(1)); in TEST()
48 ASSERT_TRUE(queue.push(2)); in TEST()
49 ASSERT_TRUE(queue.push(3)); in TEST()
50 ASSERT_FALSE(queue.push(4)) << "Queue should reach capacity at size " << capacity; in TEST()
59 BlockingQueue<int> queue(capacity); in TEST() local
62 ASSERT_TRUE(queue.push(static_cast<int>(i))); in TEST()
65 ASSERT_EQ(queue.pop(), static_cast<int>(i)); in TEST()
71 BlockingQueue<int> queue(capacity); in TEST() local
73 queue.push(1); in TEST()
74 queue.push(2); in TEST()
75 queue.clear(); in TEST()
76 queue.push(3); in TEST()
78 ASSERT_EQ(3, queue.pop()); in TEST()
83 BlockingQueue<int> queue(capacity); in TEST() local
85 queue.push(1); in TEST()
86 queue.push(2); in TEST()
87 queue.push(3); in TEST()
88 queue.push(4); in TEST()
90 queue.erase([](int element) { return element == 2 || element == 4; }); in TEST()
92 ASSERT_EQ(1, queue.pop()); in TEST()
93 ASSERT_EQ(3, queue.pop()); in TEST()
100 BlockingQueue<int> queue(capacity); in TEST() local
103 std::thread fillQueue([&queue](){ in TEST()
105 ASSERT_TRUE(queue.push(static_cast<int>(i))); in TEST()
111 ASSERT_EQ(queue.pop(), static_cast<int>(i)); in TEST()
125 BlockingQueue<int> queue(capacity); in TEST() local
130 std::thread waitUntilHasElements([&queue, &hasReceivedElement](){ in TEST()
131 queue.pop(); // This should block until an element has been added in TEST()
136 queue.push(1); in TEST()