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

Method TestListWithAutoDelete

util/generic/intrlist_ut.cpp:395–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393};
394
395void TListTest::TestListWithAutoDelete() {
396 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;
397 int counter{0};
398 {
399 TListType lst;
400 UNIT_ASSERT(lst.Empty());
401 lst.PushFront(new TSelfCountingInt(counter, 2));
402 UNIT_ASSERT_EQUAL(lst.Size(), 1);
403 UNIT_ASSERT_EQUAL(counter, 1);
404 lst.PushFront(new TSelfCountingInt(counter, 1));
405 UNIT_ASSERT_EQUAL(lst.Size(), 2);
406 UNIT_ASSERT_EQUAL(counter, 2);
407 CheckList(lst);
408 }
409
410 UNIT_ASSERT_EQUAL(counter, 0);
411}
412
413void TListTest::TestListWithAutoDeleteMoveCtor() {
414 using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>;

Callers

nothing calls this directly

Calls 4

CheckListFunction · 0.85
EmptyMethod · 0.45
PushFrontMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected