| 2244 | int MyShared::ndtor = 0; |
| 2245 | |
| 2246 | TEST_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 | |
| 2265 | TEST_F(ChannelTest, init_as_single_server) { |
| 2266 | { |
nothing calls this directly
no test coverage detected