tests: call the derived Test class cleanup() function

Calling the cleanup() function in the base class Test destructor only
calls the base class empty cleanup() function, not the overloaded one.
This results in tests not cleaning up after themself. Solve this by
explicitly calling the cleanup() function from execute().

This was discovered while running valgrind on tests where objects where
allocated in init() and freed in cleanup().

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund 2018-12-21 01:45:47 +01:00 committed by Laurent Pinchart
parent 4114a93dff
commit 53b549b631

View file

@ -13,7 +13,6 @@ Test::Test()
Test::~Test()
{
cleanup();
}
int Test::execute()
@ -24,5 +23,9 @@ int Test::execute()
if (ret < 0)
return ret;
return run();
ret = run();
cleanup();
return ret;
}