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

Function TEST_F

test/brpc_channel_unittest.cpp:2246–2263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244int MyShared::ndtor = 0;
2245
2246TEST_F(ChannelTest, intrusive_ptr_sanity) {
2247 MyShared::nctor = 0;
2248 MyShared::ndtor = 0;
2249 {
2250 MyShared* s1 = new MyShared;
2251 ASSERT_EQ(0, s1->ref_count());
2252 butil::intrusive_ptr<MyShared> p1 = s1;
2253 ASSERT_EQ(1, p1->ref_count());
2254 {
2255 butil::intrusive_ptr<MyShared> p2 = s1;
2256 ASSERT_EQ(2, p2->ref_count());
2257 ASSERT_EQ(2, p1->ref_count());
2258 }
2259 ASSERT_EQ(1, p1->ref_count());
2260 }
2261 ASSERT_EQ(1, MyShared::nctor);
2262 ASSERT_EQ(1, MyShared::ndtor);
2263}
2264
2265TEST_F(ChannelTest, init_as_single_server) {
2266 {

Callers

nothing calls this directly

Calls 15

str2endpointFunction · 0.85
SocketMapFindFunction · 0.85
SocketMapKeyClass · 0.85
bthread_start_backgroundFunction · 0.85
bthread_joinFunction · 0.85
NewCallbackFunction · 0.85
bthread_usleepFunction · 0.85
saveMethod · 0.80
fnameMethod · 0.80
ErrorCodeMethod · 0.80
ErrorTextMethod · 0.80

Tested by

no test coverage detected