2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2017-01-31 11:14:54 +01:00
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
#include "mocktimer.h"
|
2017-01-31 11:14:54 +01:00
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
MockTimer::MockTimer()
|
2017-01-31 11:14:54 +01:00
|
|
|
{
|
2017-12-13 17:35:00 +01:00
|
|
|
ON_CALL(*this, start(_)).WillByDefault(Assign(&m_isStarted, true));
|
2017-01-31 11:14:54 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
MockTimer::~MockTimer()
|
2017-01-31 11:14:54 +01:00
|
|
|
{
|
2017-12-13 17:35:00 +01:00
|
|
|
emitTimoutIfStarted();
|
2017-01-31 11:14:54 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
void MockTimer::setSingleShot(bool)
|
2017-01-31 11:14:54 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
void MockTimer::emitTimoutIfStarted()
|
2017-01-31 11:14:54 +01:00
|
|
|
{
|
|
|
|
|
if (m_isStarted)
|
|
|
|
|
emit timeout();
|
|
|
|
|
}
|