2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2017-01-31 11:14:54 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
#include "googletest.h"
|
|
|
|
|
|
2017-01-31 11:14:54 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2017-12-13 17:35:00 +01:00
|
|
|
class MockTimer : public QObject
|
2017-01-31 11:14:54 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-12-13 17:35:00 +01:00
|
|
|
MockTimer();
|
|
|
|
|
~MockTimer();
|
|
|
|
|
|
|
|
|
|
MOCK_METHOD1(start,
|
|
|
|
|
void (int));
|
2017-01-31 11:14:54 +01:00
|
|
|
|
|
|
|
|
void setSingleShot(bool);
|
|
|
|
|
|
|
|
|
|
void emitTimoutIfStarted();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void timeout();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool m_isStarted = false;
|
|
|
|
|
};
|