MCPcopy Create free account
hub / github.com/ceph/ceph / TEST_F

Function TEST_F

src/test/common/test_weighted_priority_queue.cc:163–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161};
162
163TEST_F(WeightedPriorityQueueTest, wpq_size){
164 WQ wq(0, 0);
165 EXPECT_TRUE(wq.empty());
166 EXPECT_EQ(0u, wq.get_size_slow());
167
168 // Test the strict queue size.
169 for (unsigned i = 1; i < 5; ++i) {
170 wq.enqueue_strict(Klass(i),i, std::make_tuple(i, i, i));
171 EXPECT_FALSE(wq.empty());
172 EXPECT_EQ(i, wq.get_size_slow());
173 }
174 // Test the normal queue size.
175 for (unsigned i = 5; i < 10; ++i) {
176 wq.enqueue(Klass(i), i, i, std::make_tuple(i, i, i));
177 EXPECT_FALSE(wq.empty());
178 EXPECT_EQ(i, wq.get_size_slow());
179 }
180 // Test that as both queues are emptied
181 // the size is correct.
182 for (unsigned i = 8; i >0; --i) {
183 wq.dequeue();
184 EXPECT_FALSE(wq.empty());
185 EXPECT_EQ(i, wq.get_size_slow());
186 }
187 wq.dequeue();
188 EXPECT_TRUE(wq.empty());
189 EXPECT_EQ(0u, wq.get_size_slow());
190}
191
192TEST_F(WeightedPriorityQueueTest, wpq_test_static) {
193 test_queue(1000);

Callers

nothing calls this directly

Calls 10

KlassClass · 0.85
emptyMethod · 0.45
get_size_slowMethod · 0.45
enqueue_strictMethod · 0.45
enqueueMethod · 0.45
dequeueMethod · 0.45
remove_by_classMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected