mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
test: timer: Add dynamically allocated timer test
Timers should be automatically stopped and unregistered when deleted. Add a test to verify this is the case. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
08b2e03a8a
commit
3952d49d8d
1 changed files with 11 additions and 0 deletions
|
@ -152,6 +152,17 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test that dynamically allocated timers are stopped when
|
||||
* deleted. This will result in a crash on failure.
|
||||
*/
|
||||
ManagedTimer *dyntimer = new ManagedTimer();
|
||||
dyntimer->start(100);
|
||||
delete dyntimer;
|
||||
|
||||
timer.start(200);
|
||||
dispatcher->processEvents();
|
||||
|
||||
return TestPass;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue