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

Method TestListWithAutoDeleteMoveOpEq

util/generic/intrlist_ut.cpp:433–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433void TListTest::TestListWithAutoDeleteMoveOpEq() {
434 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;
435 int counter{0};
436 {
437 TListType lst;
438 lst.PushFront(new TSelfCountingInt(counter, 2));
439 lst.PushFront(new TSelfCountingInt(counter, 1));
440 UNIT_ASSERT_EQUAL(lst.Size(), 2);
441 UNIT_ASSERT_EQUAL(counter, 2);
442 CheckList(lst);
443
444 TListType nextList;
445 UNIT_ASSERT(nextList.Empty());
446 nextList = std::move(lst);
447 UNIT_ASSERT_EQUAL(nextList.Size(), 2);
448 CheckList(nextList);
449 UNIT_ASSERT_EQUAL(counter, 2);
450 }
451
452 UNIT_ASSERT_EQUAL(counter, 0);
453}
454
455void TListTest::TestListWithAutoDeleteClear() {
456 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected