diff options
Diffstat (limited to 'tests/auto/dbus/qdbusabstractadaptor')
7 files changed, 33 insertions, 123 deletions
diff --git a/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST b/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST deleted file mode 100644 index d3d970f4f4..0000000000 --- a/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[overloadedSignalEmission] -linux diff --git a/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt index 797c56221b..01cc7613ff 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt @@ -1,8 +1,14 @@ -# Generated from qdbusabstractadaptor.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qdbusabstractadaptor LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() add_subdirectory(qmyserver) -# special case begin qt_internal_add_test(tst_qdbusabstractadaptor SOURCES myobject.h @@ -11,4 +17,4 @@ qt_internal_add_test(tst_qdbusabstractadaptor Qt::CorePrivate Qt::DBus ) -# special case end +add_dependencies(tst_qdbusabstractadaptor qmyserver) diff --git a/tests/auto/dbus/qdbusabstractadaptor/myobject.h b/tests/auto/dbus/qdbusabstractadaptor/myobject.h index 768e817043..d6e332ac1c 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/myobject.h +++ b/tests/auto/dbus/qdbusabstractadaptor/myobject.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef MYOBJECT_H #define MYOBJECT_H @@ -51,7 +26,7 @@ public slots: signature = msg.signature(); path = msg.path(); value.clear(); - if (msg.arguments().count()) + if (msg.arguments().size()) value = msg.arguments().at(0); } diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST +++ /dev/null diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt index 0ce4a3e3d3..4e33775bf1 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from qmyserver.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## qmyserver Binary: @@ -6,10 +7,10 @@ qt_internal_add_executable(qmyserver OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" - NO_INSTALL # special case + NO_INSTALL SOURCES ../myobject.h qmyserver.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::DBus ) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp index a452d299b4..fb7b659d9f 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp @@ -1,31 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// Copyright (C) 2016 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QCoreApplication> #include <QDBusServer> diff --git a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp index 23fe3ff51a..173e6e6765 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp +++ b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp @@ -1,31 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// Copyright (C) 2016 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QDebug> @@ -893,7 +868,7 @@ void tst_QDBusAbstractAdaptor::readProperties() properties.call(QDBus::BlockWithGui, "Get", "local." + name, propname); QVariant value = reply; - QCOMPARE(value.userType(), int(QVariant::String)); + QCOMPARE(value.userType(), int(QMetaType::QString)); QCOMPARE(value.toString(), QString("QString %1::%2() const").arg(name, propname)); } } @@ -982,7 +957,7 @@ void tst_QDBusAbstractAdaptor::readAllProperties() qPrintable(propname + " on " + name)); QVariant value = reply.value().value(propname); - QCOMPARE(value.userType(), int(QVariant::String)); + QCOMPARE(value.userType(), int(QMetaType::QString)); QCOMPARE(value.toString(), QString("QString %1::%2() const").arg(name, propname)); } } @@ -1084,12 +1059,6 @@ void tst_QDBusAbstractAdaptor::methodCallsPeer_data() void tst_QDBusAbstractAdaptor::methodCallsPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); - if (QSysInfo::productType().compare("opensuse", Qt::CaseInsensitive) == 0 - && QSysInfo::productVersion() == QLatin1String("42.1") - && qgetenv("QTEST_ENVIRONMENT").split(' ').contains("ci")) { - QSKIP("This test is occasionally hanging in the CI"); - } QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1152,7 +1121,6 @@ void tst_QDBusAbstractAdaptor::methodCallsPeer() void tst_QDBusAbstractAdaptor::methodCallScriptablePeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1172,7 +1140,6 @@ void tst_QDBusAbstractAdaptor::signalEmissionsPeer_data() void tst_QDBusAbstractAdaptor::signalEmissionsPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QFETCH(QString, interface); QFETCH(QString, name); QFETCH(QVariant, parameter); @@ -1237,7 +1204,6 @@ void tst_QDBusAbstractAdaptor::signalEmissionsPeer() void tst_QDBusAbstractAdaptor::sameSignalDifferentPathsPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1266,7 +1232,6 @@ void tst_QDBusAbstractAdaptor::sameSignalDifferentPathsPeer() void tst_QDBusAbstractAdaptor::sameObjectDifferentPathsPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1289,8 +1254,7 @@ void tst_QDBusAbstractAdaptor::sameObjectDifferentPathsPeer() void tst_QDBusAbstractAdaptor::scriptableSignalOrNotPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); - QDBusConnection con("peer");; + QDBusConnection con("peer"); QVERIFY(con.isConnected()); { @@ -1361,7 +1325,6 @@ void tst_QDBusAbstractAdaptor::overloadedSignalEmissionPeer_data() void tst_QDBusAbstractAdaptor::overloadedSignalEmissionPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1413,7 +1376,6 @@ void tst_QDBusAbstractAdaptor::overloadedSignalEmissionPeer() void tst_QDBusAbstractAdaptor::readPropertiesPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1430,7 +1392,7 @@ void tst_QDBusAbstractAdaptor::readPropertiesPeer() properties.call(QDBus::BlockWithGui, "Get", "local." + name, propname); QVariant value = reply; - QCOMPARE(value.userType(), int(QVariant::String)); + QCOMPARE(value.userType(), int(QMetaType::QString)); QCOMPARE(value.toString(), QString("QString %1::%2() const").arg(name, propname)); } } @@ -1438,7 +1400,6 @@ void tst_QDBusAbstractAdaptor::readPropertiesPeer() void tst_QDBusAbstractAdaptor::readPropertiesInvalidInterfacePeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1459,7 +1420,6 @@ void tst_QDBusAbstractAdaptor::readPropertiesEmptyInterfacePeer_data() void tst_QDBusAbstractAdaptor::readPropertiesEmptyInterfacePeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1490,7 +1450,6 @@ void tst_QDBusAbstractAdaptor::readPropertiesEmptyInterfacePeer() void tst_QDBusAbstractAdaptor::readAllPropertiesPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1509,7 +1468,7 @@ void tst_QDBusAbstractAdaptor::readAllPropertiesPeer() qPrintable(propname + " on " + name)); QVariant value = reply.value().value(propname); - QCOMPARE(value.userType(), int(QVariant::String)); + QCOMPARE(value.userType(), int(QMetaType::QString)); QCOMPARE(value.toString(), QString("QString %1::%2() const").arg(name, propname)); } } @@ -1517,7 +1476,6 @@ void tst_QDBusAbstractAdaptor::readAllPropertiesPeer() void tst_QDBusAbstractAdaptor::readAllPropertiesInvalidInterfacePeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1583,7 +1541,6 @@ void tst_QDBusAbstractAdaptor::readAllPropertiesEmptyInterfacePeer() void tst_QDBusAbstractAdaptor::writePropertiesPeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1865,10 +1822,9 @@ void tst_QDBusAbstractAdaptor::typeMatching() reply = iface.call(QDBus::BlockWithGui, "retrieve" + basename); QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - QCOMPARE(reply.arguments().count(), 1); + QCOMPARE(reply.arguments().size(), 1); - const QVariant &retval = reply.arguments().at(0); - QVERIFY(compare(retval, value)); + QVERIFY(compare(reply.arguments().at(0), value)); } void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValue() @@ -1883,19 +1839,18 @@ void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValue() QDBusInterface remote(con.baseService(), "/", "local.Interface3", con); QDBusMessage reply = remote.call(QDBus::BlockWithGui, "methodStringString", testString); - QCOMPARE(reply.arguments().count(), 2); + QCOMPARE(reply.arguments().size(), 2); QDBusReply<int> intreply = reply; QVERIFY(intreply.isValid()); QCOMPARE(intreply.value(), 42); - QCOMPARE(reply.arguments().at(1).userType(), int(QVariant::String)); + QCOMPARE(reply.arguments().at(1).userType(), int(QMetaType::QString)); QCOMPARE(qdbus_cast<QString>(reply.arguments().at(1)), testString); } void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValuePeer() { - QSKIP("Test is currently too flaky (QTBUG-66223)"); QDBusConnection con("peer"); QVERIFY(con.isConnected()); @@ -1906,13 +1861,13 @@ void tst_QDBusAbstractAdaptor::methodWithMoreThanOneReturnValuePeer() QDBusInterface remote(QString(), "/", "local.Interface3", con); QDBusMessage reply = remote.call(QDBus::BlockWithGui, "methodStringString", testString); - QCOMPARE(reply.arguments().count(), 2); + QCOMPARE(reply.arguments().size(), 2); QDBusReply<int> intreply = reply; QVERIFY(intreply.isValid()); QCOMPARE(intreply.value(), 42); - QCOMPARE(reply.arguments().at(1).userType(), int(QVariant::String)); + QCOMPARE(reply.arguments().at(1).userType(), int(QMetaType::QString)); QCOMPARE(qdbus_cast<QString>(reply.arguments().at(1)), testString); } |