TEST_F( SimplexSupportDoublyLinkedList, PopFrontUpdatesLastWhenListIsEmptied ) { MockStruct* m = new MockStruct(); DoublyLinkedList list; list.PushFront( m ); list.PopFront(); ASSERT_EQ ( list.Last(), nullptr ); delete(m); }
TEST_F( SimplexSupportDoublyLinkedList, PopFrontReturnsObject ) { MockStruct* m1 = new MockStruct(); DoublyLinkedList list; list.PushFront(m1); MockStruct*m2 = (MockStruct*) list.PopFront(); ASSERT_EQ(m2, m1); delete(m1); }
TEST_F( SimplexSupportDoublyLinkedList, PopFrontDeallocatesNode ) { MockStruct* m1 = new MockStruct(); DoublyLinkedList list; list.PushFront(m1); ASSERT_EQ(mAllocator->GetAllocationCount(), 1); list.PopFront(); ASSERT_EQ(mAllocator->GetAllocationCount(), 0); ASSERT_EQ(mAllocator->GetUsedMemory(), 0); delete(m1); }