| 431 | } |
| 432 | |
| 433 | void 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 | |
| 455 | void TListTest::TestListWithAutoDeleteClear() { |
| 456 | using TListType = TIntrusiveListWithAutoDelete<TSelfCountingInt, TSelfCountingIntDelete>; |