| 411 | } |
| 412 | |
| 413 | void 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 | |
| 433 | void TListTest::TestListWithAutoDeleteMoveOpEq() { |
| 434 | using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>; |