Lines Matching refs:q

30   RunQueue<int, 4> q;  in test_basic_runqueue()  local
32 VERIFY(q.Empty()); in test_basic_runqueue()
33 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
34 VERIFY_IS_EQUAL(0, q.PopFront()); in test_basic_runqueue()
36 VERIFY_IS_EQUAL(0u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
39 VERIFY_IS_EQUAL(0, q.PushFront(1)); in test_basic_runqueue()
40 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
41 VERIFY_IS_EQUAL(1, q.PopFront()); in test_basic_runqueue()
42 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
44 VERIFY_IS_EQUAL(0, q.PushFront(2)); in test_basic_runqueue()
45 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
46 VERIFY_IS_EQUAL(0, q.PushFront(3)); in test_basic_runqueue()
47 VERIFY_IS_EQUAL(2u, q.Size()); in test_basic_runqueue()
48 VERIFY_IS_EQUAL(0, q.PushFront(4)); in test_basic_runqueue()
49 VERIFY_IS_EQUAL(3u, q.Size()); in test_basic_runqueue()
50 VERIFY_IS_EQUAL(0, q.PushFront(5)); in test_basic_runqueue()
51 VERIFY_IS_EQUAL(4u, q.Size()); in test_basic_runqueue()
52 VERIFY_IS_EQUAL(6, q.PushFront(6)); in test_basic_runqueue()
53 VERIFY_IS_EQUAL(4u, q.Size()); in test_basic_runqueue()
54 VERIFY_IS_EQUAL(5, q.PopFront()); in test_basic_runqueue()
55 VERIFY_IS_EQUAL(3u, q.Size()); in test_basic_runqueue()
56 VERIFY_IS_EQUAL(4, q.PopFront()); in test_basic_runqueue()
57 VERIFY_IS_EQUAL(2u, q.Size()); in test_basic_runqueue()
58 VERIFY_IS_EQUAL(3, q.PopFront()); in test_basic_runqueue()
59 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
60 VERIFY_IS_EQUAL(2, q.PopFront()); in test_basic_runqueue()
61 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
62 VERIFY_IS_EQUAL(0, q.PopFront()); in test_basic_runqueue()
64 VERIFY_IS_EQUAL(0, q.PushBack(7)); in test_basic_runqueue()
65 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
66 VERIFY_IS_EQUAL(1u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
69 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
72 VERIFY_IS_EQUAL(0, q.PushBack(8)); in test_basic_runqueue()
73 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
74 VERIFY_IS_EQUAL(0, q.PushBack(9)); in test_basic_runqueue()
75 VERIFY_IS_EQUAL(2u, q.Size()); in test_basic_runqueue()
76 VERIFY_IS_EQUAL(0, q.PushBack(10)); in test_basic_runqueue()
77 VERIFY_IS_EQUAL(3u, q.Size()); in test_basic_runqueue()
78 VERIFY_IS_EQUAL(0, q.PushBack(11)); in test_basic_runqueue()
79 VERIFY_IS_EQUAL(4u, q.Size()); in test_basic_runqueue()
80 VERIFY_IS_EQUAL(12, q.PushBack(12)); in test_basic_runqueue()
81 VERIFY_IS_EQUAL(4u, q.Size()); in test_basic_runqueue()
83 VERIFY_IS_EQUAL(2u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
87 VERIFY_IS_EQUAL(2u, q.Size()); in test_basic_runqueue()
89 VERIFY_IS_EQUAL(1u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
92 VERIFY_IS_EQUAL(1u, q.Size()); in test_basic_runqueue()
94 VERIFY_IS_EQUAL(1u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
98 VERIFY_IS_EQUAL(0u, q.PopBackHalf(&stolen)); in test_basic_runqueue()
101 VERIFY(q.Empty()); in test_basic_runqueue()
102 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
103 VERIFY_IS_EQUAL(0, q.PushFront(1)); in test_basic_runqueue()
104 VERIFY_IS_EQUAL(0, q.PushFront(2)); in test_basic_runqueue()
105 VERIFY_IS_EQUAL(0, q.PushFront(3)); in test_basic_runqueue()
106 VERIFY_IS_EQUAL(1, q.PopBack()); in test_basic_runqueue()
107 VERIFY_IS_EQUAL(2, q.PopBack()); in test_basic_runqueue()
108 VERIFY_IS_EQUAL(3, q.PopBack()); in test_basic_runqueue()
109 VERIFY(q.Empty()); in test_basic_runqueue()
110 VERIFY_IS_EQUAL(0u, q.Size()); in test_basic_runqueue()
122 RunQueue<int, 4> q; in test_empty_runqueue() local
123 q.PushFront(1); in test_empty_runqueue()
125 std::thread mutator([&q, &done]() { in test_empty_runqueue()
130 VERIFY_IS_EQUAL(0, q.PushFront(1)); in test_empty_runqueue()
132 VERIFY_IS_EQUAL(0, q.PushBack(1)); in test_empty_runqueue()
134 VERIFY_IS_EQUAL(1, q.PopFront()); in test_empty_runqueue()
137 if (q.PopBackHalf(&stolen) == 1) { in test_empty_runqueue()
148 VERIFY(!q.Empty()); in test_empty_runqueue()
149 int size = q.Size(); in test_empty_runqueue()
153 VERIFY_IS_EQUAL(1, q.PopFront()); in test_empty_runqueue()
163 RunQueue<int, 8> q; in test_stress_runqueue() local
166 threads.emplace_back(new std::thread([&q, &total]() { in test_stress_runqueue()
172 if (q.PushFront(pushed) == 0) { in test_stress_runqueue()
178 int v = q.PopFront(); in test_stress_runqueue()
188 threads.emplace_back(new std::thread([&q, &total]() { in test_stress_runqueue()
191 if (q.PushBack(j) == 0) { in test_stress_runqueue()
200 threads.emplace_back(new std::thread([&q, &total]() { in test_stress_runqueue()
204 if (q.PopBackHalf(&stolen) == 0) { in test_stress_runqueue()
220 while ((v = q.PushBack(v)) != 0) EIGEN_THREAD_YIELD(); in test_stress_runqueue()
226 VERIFY(q.Empty()); in test_stress_runqueue()