summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusabstractinterface
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/dbus/qdbusabstractinterface')
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt13
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/interface.cpp38
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/interface.h29
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/org.qtproject.QtDBus.Pinger.xml2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt5
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt7
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp31
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp35
8 files changed, 29 insertions, 131 deletions
diff --git a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt
index 4530f60561..4010ae5682 100644
--- a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt
+++ b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt
@@ -1,8 +1,12 @@
-# Generated from qdbusabstractinterface.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-add_subdirectory(qpinger)
+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()
-# special case begin
qt_internal_add_test(tst_qdbusabstractinterface
SOURCES
interface.cpp
@@ -21,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 ef1ff74734..1226e5bb49 100644
--- a/tests/auto/dbus/qdbusabstractinterface/interface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/interface.cpp
@@ -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
#include "interface.h"
#include <QThread>
@@ -33,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 f9e6c0e028..53744998d0 100644
--- a/tests/auto/dbus/qdbusabstractinterface/interface.h
+++ b/tests/auto/dbus/qdbusabstractinterface/interface.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 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 3df1ff8177..55634f0677 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt
+++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt
@@ -1,9 +1,8 @@
-# Generated from qdbusabstractinterface.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# 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 f5658b96a6..362928712d 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt
+++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qpinger.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## qpinger Binary:
@@ -6,10 +7,10 @@
qt_internal_add_executable(qpinger
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
- NO_INSTALL # special case
+ NO_INSTALL
SOURCES
../interface.cpp ../interface.h
qpinger.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::DBus
)
diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
index 2ff7d31332..47e5becc15 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.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>
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 7cdf9dfe9c..ec585948d7 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.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 <QTestEventLoop>
@@ -889,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);
}
@@ -971,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);
}