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

Method TestListWithAutoDeleteMoveCtor

util/generic/intrlist_ut.cpp:413–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413void TListTest::TestListWithAutoDeleteMoveCtor() {
414 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;
415 int counter{0};
416 {
417 TListType lst;
418 lst.PushFront(new TSelfCountingInt(counter, 2));
419 lst.PushFront(new TSelfCountingInt(counter, 1));
420 UNIT_ASSERT_EQUAL(lst.Size(), 2);
421 UNIT_ASSERT_EQUAL(counter, 2);
422 CheckList(lst);
423
424 TListType nextList(std::move(lst));
425 UNIT_ASSERT_EQUAL(nextList.Size(), 2);
426 CheckList(nextList);
427 UNIT_ASSERT_EQUAL(counter, 2);
428 }
429
430 UNIT_ASSERT_EQUAL(counter, 0);
431}
432
433void TListTest::TestListWithAutoDeleteMoveOpEq() {
434 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;

Callers

nothing calls this directly

Calls 4

CheckListFunction · 0.85
moveFunction · 0.50
PushFrontMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected