In googletest you can use ASSERT_THROW
to test that a certain function throws an error. For instance
ASSERT_THROW(PhysicalPropertyResource p("other/identifier72652"), InappropriateResourceException);
How would you explicitely call another method for releasing some memory used by PhysicalPropertyResource
? Normally used like so:
PhysicalPropertyResource p("other/identifier72652");
p.free();
Or should I just not worry about the memory leak since its only in a test and therefore benign. (Its just my OCD to want to keep valgrind completly happy).
I've tried this:
ASSERT_THROW(
PhysicalPropertyResource p("other/identifier72652");
p.free();
, InappropriateResourceException);
}
which doesn't free the memory.