diff options
Diffstat (limited to 'tests/auto/network/socket/qsocks5socketengine')
3 files changed, 23 insertions, 46 deletions
diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST index 405d03f990..6b3a39ab5e 100644 --- a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST +++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST @@ -1,12 +1,10 @@ [udpTest] * [passwordAuth] -ubuntu-18.04 -ubuntu-20.04 +ubuntu +# QTBUG-101274 +qnx ci # QTBUG-74162 [passwordAuth2] ubuntu -[downloadBigFile] -windows-10 msvc-2015 -windows-7sp1 diff --git a/tests/auto/network/socket/qsocks5socketengine/CMakeLists.txt b/tests/auto/network/socket/qsocks5socketengine/CMakeLists.txt index 64f3aa7a9e..dc0b87cd94 100644 --- a/tests/auto/network/socket/qsocks5socketengine/CMakeLists.txt +++ b/tests/auto/network/socket/qsocks5socketengine/CMakeLists.txt @@ -1,4 +1,11 @@ -# Generated from qsocks5socketengine.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_qsocks5socketengine LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() if(NOT QT_FEATURE_private_tests) return() @@ -11,23 +18,18 @@ endif() qt_internal_add_test(tst_qsocks5socketengine SOURCES tst_qsocks5socketengine.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::NetworkPrivate - QT_TEST_SERVER_LIST "danted" "apache2" "cyrus" # special case + QT_TEST_SERVER_LIST "danted" "apache2" "cyrus" ) -#### Keys ignored in scope 1:.:.:qsocks5socketengine.pro:<TRUE>: -# MOC_DIR = "tmp" -# _REQUIREMENTS = "qtConfig(private_tests)" - ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:.:qsocks5socketengine.pro:LINUX: # QT_TEST_SERVER_LIST = "danted" "apache2" "cyrus" qt_internal_extend_target(tst_qsocks5socketengine CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES ws2_32 ) diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 11e17cb319..cc77ba2da3 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.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 <QtTest/QTest> @@ -48,6 +23,8 @@ #include "../../../network-settings.h" +using namespace std::chrono_literals; + class tst_QSocks5SocketEngine : public QObject, public QAbstractSocketEngineReceiver { Q_OBJECT @@ -366,7 +343,7 @@ void tst_QSocks5SocketEngine::simpleErrorsAndStates() QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState); QVERIFY(!socketDevice.connectToHost(QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses().first(), 8088)); QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState); - if (socketDevice.waitForWrite(15000)) { + if (socketDevice.waitForWrite(15s)) { QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState || socketDevice.state() == QAbstractSocket::ConnectedState); } else { @@ -940,13 +917,13 @@ void tst_QSocks5SocketEngine::fragmentation_data() responses << authMethodBasic << authSuccess.left(1) << authSuccess.mid(1) << connectResponseIPv4; QTest::newRow("auth-response") << responses; - for (int i = 1; i < connectResponseIPv4.length() - 1; i++) { + for (int i = 1; i < connectResponseIPv4.size() - 1; i++) { responses.clear(); responses << authMethodNone << connectResponseIPv4.left(i) << connectResponseIPv4.mid(i); QTest::newRow(qPrintable(QString("connect-response-ipv4-") + QString::number(i))) << responses; } - for (int i = 1; i < connectResponseIPv6.length() - 1; i++) { + for (int i = 1; i < connectResponseIPv6.size() - 1; i++) { responses.clear(); responses << authMethodNone << connectResponseIPv6.left(i) << connectResponseIPv6.mid(i); QTest::newRow(qPrintable(QString("connect-response-ipv6-") + QString::number(i))) << responses; @@ -989,13 +966,13 @@ void tst_QSocks5SocketEngine::incomplete_data() responses << authMethodBasic << authSuccess.left(1); QTest::newRow("auth-response") << responses; - for (int i = 1; i < connectResponseIPv4.length() - 1; i++) { + for (int i = 1; i < connectResponseIPv4.size() - 1; i++) { responses.clear(); responses << authMethodNone << connectResponseIPv4.left(i); QTest::newRow(qPrintable(QString("connect-response-ipv4-") + QString::number(i))) << responses; } - for (int i = 1; i < connectResponseIPv6.length() - 1; i++) { + for (int i = 1; i < connectResponseIPv6.size() - 1; i++) { responses.clear(); responses << authMethodNone << connectResponseIPv6.left(i); QTest::newRow(qPrintable(QString("connect-response-ipv6-") + QString::number(i))) << responses; |