diff options
Diffstat (limited to 'tests/auto/network/kernel/qnetworkinformation')
-rw-r--r-- | tests/auto/network/kernel/qnetworkinformation/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/network/kernel/qnetworkinformation/tst_qnetworkinformation.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/network/kernel/qnetworkinformation/CMakeLists.txt b/tests/auto/network/kernel/qnetworkinformation/CMakeLists.txt index 4c473cd4b3..354cefc993 100644 --- a/tests/auto/network/kernel/qnetworkinformation/CMakeLists.txt +++ b/tests/auto/network/kernel/qnetworkinformation/CMakeLists.txt @@ -1,6 +1,12 @@ # 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_qnetworkinformation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qnetworkinformation SOURCES tst_qnetworkinformation.cpp diff --git a/tests/auto/network/kernel/qnetworkinformation/tst_qnetworkinformation.cpp b/tests/auto/network/kernel/qnetworkinformation/tst_qnetworkinformation.cpp index cde2399424..daf81823e8 100644 --- a/tests/auto/network/kernel/qnetworkinformation/tst_qnetworkinformation.cpp +++ b/tests/auto/network/kernel/qnetworkinformation/tst_qnetworkinformation.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 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 <QtNetwork/private/qnetworkinformation_p.h> #include <QtNetwork/qnetworkinformation.h> @@ -241,14 +241,14 @@ void tst_QNetworkInformation::isMetered() QSignalSpy spy(info, &QNetworkInformation::isMeteredChanged); QVERIFY(!info->isMetered()); MockBackend::setNewMetered(true); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); QVERIFY(info->isMetered()); QVERIFY(spy[0][0].toBool()); spy.clear(); // Set the same value again, signal should not be emitted again MockBackend::setNewMetered(true); - QCOMPARE(spy.count(), 0); + QCOMPARE(spy.size(), 0); } QTEST_MAIN(tst_QNetworkInformation); |