MCPcopy Create free account
hub / github.com/apache/brpc / TEST

Function TEST

test/bvar_sampler_unittest.cpp:26–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace {
25
26TEST(SamplerTest, linked_list) {
27 butil::LinkNode<bvar::detail::Sampler> n1, n2;
28 n1.InsertBeforeAsList(&n2);
29 ASSERT_EQ(n1.next(), &n2);
30 ASSERT_EQ(n1.previous(), &n2);
31 ASSERT_EQ(n2.next(), &n1);
32 ASSERT_EQ(n2.previous(), &n1);
33
34 butil::LinkNode<bvar::detail::Sampler> n3, n4;
35 n3.InsertBeforeAsList(&n4);
36 ASSERT_EQ(n3.next(), &n4);
37 ASSERT_EQ(n3.previous(), &n4);
38 ASSERT_EQ(n4.next(), &n3);
39 ASSERT_EQ(n4.previous(), &n3);
40
41 n1.InsertBeforeAsList(&n3);
42 ASSERT_EQ(n1.next(), &n2);
43 ASSERT_EQ(n2.next(), &n3);
44 ASSERT_EQ(n3.next(), &n4);
45 ASSERT_EQ(n4.next(), &n1);
46 ASSERT_EQ(&n1, n2.previous());
47 ASSERT_EQ(&n2, n3.previous());
48 ASSERT_EQ(&n3, n4.previous());
49 ASSERT_EQ(&n4, n1.previous());
50}
51
52class DebugSampler : public bvar::detail::Sampler {
53public:

Callers

nothing calls this directly

Calls 8

SetLogSinkFunction · 0.85
InsertBeforeAsListMethod · 0.80
previousMethod · 0.80
called_countMethod · 0.80
nextMethod · 0.45
scheduleMethod · 0.45
destroyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected