diff options
Diffstat (limited to 'tests/auto/testlib/selftests/eventloop')
-rw-r--r-- | tests/auto/testlib/selftests/eventloop/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/auto/testlib/selftests/eventloop/CMakeLists.txt b/tests/auto/testlib/selftests/eventloop/CMakeLists.txt index 94636d40f8..afaf766f69 100644 --- a/tests/auto/testlib/selftests/eventloop/CMakeLists.txt +++ b/tests/auto/testlib/selftests/eventloop/CMakeLists.txt @@ -1,9 +1,12 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## eventloop Binary: ##################################################################### qt_internal_add_executable(eventloop NO_INSTALL + EXCEPTIONS OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} SOURCES tst_eventloop.cpp diff --git a/tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp b/tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp index 202a8b77f1..3f3a7e303e 100644 --- a/tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp +++ b/tests/auto/testlib/selftests/eventloop/tst_eventloop.cpp @@ -1,10 +1,12 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QTestEventLoop> #include <QtCore/QTimer> +using namespace std::chrono_literals; + // Tests for QTestEventLoop (and some QTRY_* details) class tst_EventLoop: public QObject { @@ -51,7 +53,7 @@ void tst_EventLoop::cleanup() { DeferredFlag flag; auto &loop = QTestEventLoop::instance(); - loop.enterLoopMSecs(100); + loop.enterLoop(100ms); QVERIFY2(loop.timeout(), "QTestEventLoop exited prematurely in cleanup()"); QVERIFY(flag); } @@ -81,7 +83,7 @@ void tst_EventLoop::pass() { DeferredFlag flag; auto &loop = QTestEventLoop::instance(); - loop.enterLoopMSecs(100); + loop.enterLoop(100ms); QVERIFY(loop.timeout()); QVERIFY(flag); } @@ -92,10 +94,10 @@ void tst_EventLoop::pass() DeferredFlag flag; QTestEventLoop loop(this); QVERIFY(!flag); - loop.enterLoopMSecs(1); + loop.enterLoop(1ms); QVERIFY(loop.timeout()); QVERIFY(!flag); - loop.enterLoopMSecs(100); + loop.enterLoop(100ms); QVERIFY(loop.timeout()); QVERIFY(flag); } |