Test QTimer's isSingleShot() and timerType()
Previously neglected in testing. Task-number: QTBUG-88183 Change-Id: Iacfca6f8c590af6dccb126cf3e43387ed50dbf06 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
06c898d7a9
commit
26e41291bb
|
|
@ -1,6 +1,6 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2016 Intel Corporation.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
|
|
@ -93,8 +93,10 @@ private slots:
|
|||
void tst_QTimer::zeroTimer()
|
||||
{
|
||||
QTimer timer;
|
||||
QVERIFY(!timer.isSingleShot());
|
||||
timer.setInterval(0);
|
||||
timer.setSingleShot(true);
|
||||
QVERIFY(timer.isSingleShot());
|
||||
|
||||
QSignalSpy timeoutSpy(&timer, &QTimer::timeout);
|
||||
timer.start();
|
||||
|
|
@ -108,7 +110,9 @@ void tst_QTimer::zeroTimer()
|
|||
void tst_QTimer::singleShotTimeout()
|
||||
{
|
||||
QTimer timer;
|
||||
QVERIFY(!timer.isSingleShot());
|
||||
timer.setSingleShot(true);
|
||||
QVERIFY(timer.isSingleShot());
|
||||
|
||||
QSignalSpy timeoutSpy(&timer, &QTimer::timeout);
|
||||
timer.start(100);
|
||||
|
|
@ -206,7 +210,9 @@ void tst_QTimer::remainingTimeInitial()
|
|||
QFETCH(Qt::TimerType, timerType);
|
||||
|
||||
QTimer timer;
|
||||
QCOMPARE(timer.timerType(), Qt::CoarseTimer);
|
||||
timer.setTimerType(timerType);
|
||||
QCOMPARE(timer.timerType(), timerType);
|
||||
timer.start(startTimeMs);
|
||||
|
||||
const int rt = timer.remainingTime();
|
||||
|
|
|
|||
Loading…
Reference in New Issue