Lines Matching refs:q
43 PriorityQueue<int> q; in TEST() local
44 EXPECT_TRUE(q.empty()); in TEST()
45 EXPECT_EQ(0, q.size()); in TEST()
46 EXPECT_EQ(0, q.capacity()); in TEST()
50 PriorityQueue<int> q; in TEST() local
52 EXPECT_TRUE(q.push(0)); in TEST()
53 EXPECT_TRUE(q.push(2)); in TEST()
54 EXPECT_TRUE(q.push(3)); in TEST()
55 EXPECT_TRUE(q.push(1)); in TEST()
56 q.pop(); in TEST()
57 EXPECT_TRUE(q.push(4)); in TEST()
61 PriorityQueue<int> q; in TEST() local
63 q.push(1); in TEST()
64 EXPECT_EQ(1, q.size()); in TEST()
65 q.push(2); in TEST()
66 EXPECT_EQ(2, q.size()); in TEST()
67 q.pop(); in TEST()
68 EXPECT_EQ(1, q.size()); in TEST()
72 PriorityQueue<int> q; in TEST() local
74 q.push(1); in TEST()
75 EXPECT_FALSE(q.empty()); in TEST()
76 q.push(2); in TEST()
77 EXPECT_FALSE(q.empty()); in TEST()
78 q.pop(); in TEST()
79 EXPECT_FALSE(q.empty()); in TEST()
80 q.pop(); in TEST()
81 EXPECT_TRUE(q.empty()); in TEST()
85 PriorityQueue<int> q; in TEST() local
87 q.push(1); in TEST()
88 EXPECT_EQ(1, q.capacity()); in TEST()
89 q.push(2); in TEST()
90 EXPECT_EQ(2, q.capacity()); in TEST()
91 q.push(3); in TEST()
92 EXPECT_EQ(4, q.capacity()); in TEST()
96 PriorityQueue<int> q; in TEST() local
97 q.pop(); in TEST()
98 EXPECT_EQ(0, q.size()); in TEST()
102 PriorityQueue<int> q; in TEST() local
103 EXPECT_DEATH(q.top(), ""); in TEST()
107 PriorityQueue<int> q; in TEST() local
108 q.push(1); in TEST()
109 EXPECT_EQ(1, q.top()); in TEST()
110 q.push(2); in TEST()
111 q.push(3); in TEST()
112 EXPECT_EQ(3, q.top()); in TEST()
113 q.pop(); in TEST()
114 EXPECT_EQ(2, q.top()); in TEST()
115 q.pop(); in TEST()
116 EXPECT_EQ(1, q.top()); in TEST()
120 PriorityQueue<int> q; in TEST() local
121 EXPECT_DEATH(q[0], ""); in TEST()
125 PriorityQueue<int> q; in TEST() local
126 q.push(1); in TEST()
127 q.push(2); in TEST()
128 EXPECT_EQ(2, q[0]); in TEST()
129 EXPECT_EQ(1, q[1]); in TEST()
131 q.pop(); in TEST()
132 EXPECT_EQ(1, q[0]); in TEST()
136 PriorityQueue<int> q; in TEST() local
137 EXPECT_DEATH(q.remove(0), ""); in TEST()
138 EXPECT_EQ(0, q.size()); in TEST()
142 PriorityQueue<int> q; in TEST() local
143 q.push(1); in TEST()
144 q.push(2); in TEST()
145 q.remove(0); in TEST()
146 EXPECT_EQ(1, q.top()); in TEST()
147 EXPECT_EQ(1, q.size()); in TEST()
149 q.push(3); in TEST()
150 q.remove(1); in TEST()
151 EXPECT_EQ(3, q.top()); in TEST()
152 EXPECT_EQ(1, q.size()); in TEST()
156 PriorityQueue<int, std::greater<int>> q; in TEST() local
158 EXPECT_TRUE(q.push(0)); in TEST()
159 EXPECT_TRUE(q.push(2)); in TEST()
160 EXPECT_TRUE(q.push(3)); in TEST()
161 EXPECT_TRUE(q.push(1)); in TEST()
164 EXPECT_EQ(i, q.top()); in TEST()
165 q.pop(); in TEST()
173 PriorityQueue<FakeElement, decltype(cmp)> q(cmp); in TEST() local
175 EXPECT_TRUE(q.emplace(0, 0)); in TEST()
176 EXPECT_TRUE(q.emplace(1, 2)); in TEST()
177 EXPECT_TRUE(q.emplace(2, 1)); in TEST()
178 EXPECT_EQ(3, q.size()); in TEST()
180 EXPECT_EQ(0, q.top().getValue()); in TEST()
181 EXPECT_EQ(0, q.top().getIndex()); in TEST()
183 q.pop(); in TEST()
184 EXPECT_EQ(1, q.top().getValue()); in TEST()
185 EXPECT_EQ(2, q.top().getIndex()); in TEST()
187 q.pop(); in TEST()
188 EXPECT_EQ(2, q.top().getValue()); in TEST()
189 EXPECT_EQ(1, q.top().getIndex()); in TEST()
195 q(compareFunction); in TEST() local
197 EXPECT_TRUE(q.emplace(0, 0)); in TEST()
198 EXPECT_TRUE(q.emplace(1, 2)); in TEST()
199 EXPECT_TRUE(q.emplace(2, 1)); in TEST()
200 EXPECT_EQ(3, q.size()); in TEST()
202 EXPECT_EQ(0, q.top().getValue()); in TEST()
203 EXPECT_EQ(0, q.top().getIndex()); in TEST()
205 q.pop(); in TEST()
206 EXPECT_EQ(1, q.top().getValue()); in TEST()
207 EXPECT_EQ(2, q.top().getIndex()); in TEST()
209 q.pop(); in TEST()
210 EXPECT_EQ(2, q.top().getValue()); in TEST()
211 EXPECT_EQ(1, q.top().getIndex()); in TEST()
215 PriorityQueue<FakeElement, CompareClass> q; in TEST() local
217 EXPECT_TRUE(q.emplace(0, 0)); in TEST()
218 EXPECT_TRUE(q.emplace(1, 2)); in TEST()
219 EXPECT_TRUE(q.emplace(2, 1)); in TEST()
220 EXPECT_EQ(3, q.size()); in TEST()
222 EXPECT_EQ(0, q.top().getValue()); in TEST()
223 EXPECT_EQ(0, q.top().getIndex()); in TEST()
225 q.pop(); in TEST()
226 EXPECT_EQ(1, q.top().getValue()); in TEST()
227 EXPECT_EQ(2, q.top().getIndex()); in TEST()
229 q.pop(); in TEST()
230 EXPECT_EQ(2, q.top().getValue()); in TEST()
231 EXPECT_EQ(1, q.top().getIndex()); in TEST()
235 PriorityQueue<int> q; in TEST() local
236 q.push(0); in TEST()
237 q.push(1); in TEST()
238 q.push(2); in TEST()
240 PriorityQueue<int>::iterator it = q.begin(); in TEST()
241 EXPECT_EQ(q[0], *it); in TEST()
243 it += q.size(); in TEST()
244 EXPECT_TRUE(it == q.end()); in TEST()
248 PriorityQueue<int> q; in TEST() local
249 q.push(0); in TEST()
250 q.push(1); in TEST()
251 q.push(2); in TEST()
253 PriorityQueue<int>::const_iterator cit = q.cbegin(); in TEST()
254 EXPECT_EQ(q[0], *cit); in TEST()
256 cit += q.size(); in TEST()
257 EXPECT_TRUE(cit == q.cend()); in TEST()