mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
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:
parent
4114a93dff
commit
53b549b631
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue