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

Method TestIntrusiveConstConvertion

util/generic/ptr_ut.cpp:410–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410void TPointerTest::TestIntrusiveConstConvertion() {
411 using namespace NTestIntrusiveConvertion;
412
413 TIntrusiveConstPtr<TAA> aa = new TAA;
414
415 UNIT_ASSERT_VALUES_EQUAL(aa->RefCount(), 1);
416 TIntrusiveConstPtr<TA> a = aa;
417 UNIT_ASSERT_VALUES_EQUAL(aa->RefCount(), 2);
418 UNIT_ASSERT_VALUES_EQUAL(a->RefCount(), 2);
419 aa.Reset();
420 UNIT_ASSERT_VALUES_EQUAL(a->RefCount(), 1);
421
422 // test that Func(TIntrusiveConstPtr<TB>) doesn't participate in overload resolution
423 Func(aa);
424}
425
426void TPointerTest::TestMakeIntrusive() {
427 {

Callers

nothing calls this directly

Calls 3

FuncFunction · 0.70
RefCountMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected