| 392 | } // namespace NTestIntrusiveConvertion |
| 393 | |
| 394 | void TPointerTest::TestIntrusiveConvertion() { |
| 395 | using namespace NTestIntrusiveConvertion; |
| 396 | |
| 397 | TIntrusivePtr<TAA> aa = new TAA; |
| 398 | |
| 399 | UNIT_ASSERT_VALUES_EQUAL(aa->RefCount(), 1); |
| 400 | TIntrusivePtr<TA> a = aa; |
| 401 | UNIT_ASSERT_VALUES_EQUAL(aa->RefCount(), 2); |
| 402 | UNIT_ASSERT_VALUES_EQUAL(a->RefCount(), 2); |
| 403 | aa.Reset(); |
| 404 | UNIT_ASSERT_VALUES_EQUAL(a->RefCount(), 1); |
| 405 | |
| 406 | // test that Func(TIntrusivePtr<TB>) doesn't participate in overload resolution |
| 407 | Func(aa); |
| 408 | } |
| 409 | |
| 410 | void TPointerTest::TestIntrusiveConstConvertion() { |
| 411 | using namespace NTestIntrusiveConvertion; |