#include #include "backend/PtrList.h" class FooBar { int val = 3; bool other = 4; }; TEST(PtrListTest, FreePointers) { // PtrList only works on classes: FooBar * ptr1 = new FooBar(); FooBar * ptr2 = new FooBar(); { PtrList foo; foo.push_back(ptr1); foo.push_back(ptr2); // this destructor SHOULD free ptr1 and ptr2 } ASSERT_NE(ptr1, nullptr); ASSERT_NE(ptr2, nullptr); }