test: Simplify tests with parent-child relationships
Create object instances with a parent to avoid the need for reparenting objects manually. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -20,7 +20,7 @@ class TimeoutHandler : public Object
|
||||
{
|
||||
public:
|
||||
TimeoutHandler()
|
||||
: timeout_(false)
|
||||
: timer_(this), timeout_(false)
|
||||
{
|
||||
timer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);
|
||||
timer_.start(100);
|
||||
@@ -31,12 +31,6 @@ public:
|
||||
return timeout_;
|
||||
}
|
||||
|
||||
void moveToThread(Thread *thread)
|
||||
{
|
||||
Object::moveToThread(thread);
|
||||
timer_.moveToThread(thread);
|
||||
}
|
||||
|
||||
private:
|
||||
void timeoutHandler(Timer *timer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user