diff options
Diffstat (limited to 'tests/auto/dbus/qdbusabstractinterface')
8 files changed, 19 insertions, 30 deletions
diff --git a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt index 6b63fab315..4010ae5682 100644 --- a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt @@ -1,11 +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: BSD-3-Clause -# Generated from qdbusabstractinterface.pro. +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qdbusabstractinterface LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() -add_subdirectory(qpinger) - -# special case begin qt_internal_add_test(tst_qdbusabstractinterface SOURCES interface.cpp @@ -24,4 +25,5 @@ qt_internal_extend_target(tst_qdbusabstractinterface -i interface.h ) -# special case end +add_subdirectory(qpinger) +add_dependencies(tst_qdbusabstractinterface qpinger) diff --git a/tests/auto/dbus/qdbusabstractinterface/interface.cpp b/tests/auto/dbus/qdbusabstractinterface/interface.cpp index 293996b4bb..1226e5bb49 100644 --- a/tests/auto/dbus/qdbusabstractinterface/interface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/interface.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 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 "interface.h" #include <QThread> @@ -8,16 +8,9 @@ Interface::Interface() { } -// Export the sleep function -// TODO QT5: remove this class, QThread::msleep is now public -class FriendlySleepyThread : public QThread { -public: - using QThread::msleep; -}; - int Interface::sleepMethod(int msec) { - FriendlySleepyThread::msleep(msec); + QThread::sleep(std::chrono::milliseconds{msec}); return 42; } diff --git a/tests/auto/dbus/qdbusabstractinterface/interface.h b/tests/auto/dbus/qdbusabstractinterface/interface.h index ed7e0db444..53744998d0 100644 --- a/tests/auto/dbus/qdbusabstractinterface/interface.h +++ b/tests/auto/dbus/qdbusabstractinterface/interface.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 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 #ifndef INTERFACE_H #define INTERFACE_H diff --git a/tests/auto/dbus/qdbusabstractinterface/org.qtproject.QtDBus.Pinger.xml b/tests/auto/dbus/qdbusabstractinterface/org.qtproject.QtDBus.Pinger.xml index ad61351cb2..70d5a4e9c3 100644 --- a/tests/auto/dbus/qdbusabstractinterface/org.qtproject.QtDBus.Pinger.xml +++ b/tests/auto/dbus/qdbusabstractinterface/org.qtproject.QtDBus.Pinger.xml @@ -12,7 +12,7 @@ </signal> <signal name="complexSignal"> <arg name="" type="(s)"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="RegisteredType"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RegisteredType"/> </signal> <method name="voidMethod" /> <method name="sleepMethod"> diff --git a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt index eeddbf981b..55634f0677 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt @@ -1,12 +1,8 @@ # Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -# Generated from qdbusabstractinterface.pro. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qdbusabstractinterface Test: ##################################################################### -# special case begin # this test can not be generated here. It needs to be set up in the # parent directory -# special case end diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt index b0fc964759..362928712d 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt @@ -1,7 +1,5 @@ # Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -# Generated from qpinger.pro. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## qpinger Binary: @@ -9,7 +7,7 @@ qt_internal_add_executable(qpinger OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" - NO_INSTALL # special case + NO_INSTALL SOURCES ../interface.cpp ../interface.h qpinger.cpp diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp index 2b51016b64..47e5becc15 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2016 Intel Corporation. -// 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 <QCoreApplication> diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 752970b42c..ec585948d7 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // Copyright (C) 2016 Intel Corporation. -// 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> @@ -864,7 +864,7 @@ void tst_QDBusAbstractInterface::getStringSignal() QCOMPARE(s.size(), 1); QCOMPARE(s[0].size(), 1); - QCOMPARE(s[0][0].userType(), int(QVariant::String)); + QCOMPARE(s[0][0].userType(), int(QMetaType::QString)); QCOMPARE(s[0][0].toString(), expectedValue); } @@ -946,7 +946,7 @@ void tst_QDBusAbstractInterface::getStringSignalPeer() QCOMPARE(s.size(), 1); QCOMPARE(s[0].size(), 1); - QCOMPARE(s[0][0].userType(), int(QVariant::String)); + QCOMPARE(s[0][0].userType(), int(QMetaType::QString)); QCOMPARE(s[0][0].toString(), expectedValue); } |