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

Function TEST_F

src/test/common/test_prioritized_queue.cc:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34};
35
36TEST_F(PrioritizedQueueTest, capacity) {
37 const unsigned min_cost = 10;
38 const unsigned max_tokens_per_subqueue = 50;
39 PQ pq(max_tokens_per_subqueue, min_cost);
40 EXPECT_TRUE(pq.empty());
41 EXPECT_EQ(0u, pq.length());
42
43 pq.enqueue_strict(Klass(1), 0, Item(0));
44 EXPECT_FALSE(pq.empty());
45 EXPECT_EQ(1u, pq.length());
46
47 for (int i = 0; i < 3; i++) {
48 pq.enqueue(Klass(1), 0, 10, Item(0));
49 }
50 for (unsigned i = 4; i > 0; i--) {
51 EXPECT_FALSE(pq.empty());
52 EXPECT_EQ(i, pq.length());
53 pq.dequeue();
54 }
55 EXPECT_TRUE(pq.empty());
56 EXPECT_EQ(0u, pq.length());
57}
58
59TEST_F(PrioritizedQueueTest, strict_pq) {
60 const unsigned min_cost = 1;

Callers

nothing calls this directly

Calls 13

KlassClass · 0.85
ItemClass · 0.70
removeFunction · 0.50
emptyMethod · 0.45
lengthMethod · 0.45
enqueue_strictMethod · 0.45
enqueueMethod · 0.45
dequeueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
remove_by_classMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected