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

Method TestCopyPtr

util/generic/ptr_ut.cpp:287–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287void TPointerTest::TestCopyPtr() {
288 TCopyPtr<A> a1(MakeA());
289 {
290 TCopyPtr<A> a2(MakeA());
291 TCopyPtr<A> a3 = a2;
292 UNIT_ASSERT_VALUES_EQUAL(cnt, 3);
293
294 a1 = a2;
295 a2 = a3;
296 }
297 UNIT_ASSERT_VALUES_EQUAL(cnt, 1);
298 a1.Destroy();
299
300 UNIT_ASSERT_VALUES_EQUAL(cnt, 0);
301}
302
303class TOp: public TSimpleRefCount<TOp>, public TNonCopyable {
304public:

Callers

nothing calls this directly

Calls 2

MakeAFunction · 0.85
DestroyMethod · 0.45

Tested by

no test coverage detected