summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp')
-rw-r--r--tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp87
1 files changed, 31 insertions, 56 deletions
diff --git a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
index 3758824a9e..741c50217f 100644
--- a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
+++ b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.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 <QtTest/private/qpropertytesthelper_p.h>
@@ -124,12 +99,12 @@ void tst_QDBusServiceWatcher::watchForCreation()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyU.count(), 0);
+ QCOMPARE(spyU.size(), 0);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QVERIFY(spyO.at(0).at(1).toString().isEmpty());
QCOMPARE(spyO.at(0).at(2).toString(), con.baseService());
@@ -147,12 +122,12 @@ void tst_QDBusServiceWatcher::watchForCreation()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyU.count(), 0);
+ QCOMPARE(spyU.size(), 0);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QVERIFY(spyO.at(0).at(1).toString().isEmpty());
QCOMPARE(spyO.at(0).at(2).toString(), con.baseService());
@@ -188,12 +163,12 @@ void tst_QDBusServiceWatcher::watchForDisappearance()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 0);
+ QCOMPARE(spyR.size(), 0);
- QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.size(), 1);
QCOMPARE(spyU.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QCOMPARE(spyO.at(0).at(1).toString(), con.baseService());
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
@@ -222,12 +197,12 @@ void tst_QDBusServiceWatcher::watchForDisappearanceUniqueConnection()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 0);
+ QCOMPARE(spyR.size(), 0);
- QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.size(), 1);
QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), watchedName);
QCOMPARE(spyO.at(0).at(1).toString(), watchedName);
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
@@ -259,12 +234,12 @@ void tst_QDBusServiceWatcher::watchForOwnerChange()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyU.count(), 0);
+ QCOMPARE(spyU.size(), 0);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QVERIFY(spyO.at(0).at(1).toString().isEmpty());
QCOMPARE(spyO.at(0).at(2).toString(), con.baseService());
@@ -282,13 +257,13 @@ void tst_QDBusServiceWatcher::watchForOwnerChange()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.size(), 1);
QCOMPARE(spyU.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyO.count(), 2);
+ QCOMPARE(spyO.size(), 2);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QCOMPARE(spyO.at(0).at(1).toString(), con.baseService());
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
@@ -323,12 +298,12 @@ void tst_QDBusServiceWatcher::modeChange()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyU.count(), 0);
+ QCOMPARE(spyU.size(), 0);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QVERIFY(spyO.at(0).at(1).toString().isEmpty());
QCOMPARE(spyO.at(0).at(2).toString(), con.baseService());
@@ -346,12 +321,12 @@ void tst_QDBusServiceWatcher::modeChange()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 0);
+ QCOMPARE(spyR.size(), 0);
- QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.size(), 1);
QCOMPARE(spyU.at(0).at(0).toString(), registeredName);
- QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.size(), 1);
QCOMPARE(spyO.at(0).at(0).toString(), registeredName);
QCOMPARE(spyO.at(0).at(1).toString(), con.baseService());
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
@@ -402,9 +377,9 @@ void tst_QDBusServiceWatcher::setConnection()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.size(), 1);
QCOMPARE(spyR.at(0).at(0).toString(), serviceName);
- QCOMPARE(spyU.count(), 0);
+ QCOMPARE(spyU.size(), 0);
// is the system bus available?
if (!QDBusConnection::systemBus().isConnected())
@@ -425,9 +400,9 @@ void tst_QDBusServiceWatcher::setConnection()
QTestEventLoop::instance().enterLoop(1);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(spyR.count(), 0);
+ QCOMPARE(spyR.size(), 0);
- QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.size(), 1);
QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
}