MCPcopy Create free account
hub / github.com/catboost/catboost / TestIntrusiveConvertion

Method TestIntrusiveConvertion

util/generic/ptr_ut.cpp:394–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392} // namespace NTestIntrusiveConvertion
393
394void 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
410void TPointerTest::TestIntrusiveConstConvertion() {
411 using namespace NTestIntrusiveConvertion;

Callers

nothing calls this directly

Calls 3

FuncFunction · 0.70
RefCountMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected