summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qhttpsocketengine
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/socket/qhttpsocketengine')
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/BLACKLIST3
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt15
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp10
3 files changed, 13 insertions, 15 deletions
diff --git a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
index ceb3b7862e..e0cd701636 100644
--- a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
+++ b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
@@ -1,5 +1,2 @@
-[downloadBigFile]
-windows-10 msvc-2015
-windows-7sp1
[ensureEofTriggersNotification]
windows
diff --git a/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt b/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt
index a4168ba257..6b4f904725 100644
--- a/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt
+++ b/tests/auto/network/socket/qhttpsocketengine/CMakeLists.txt
@@ -1,7 +1,11 @@
# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+# SPDX-License-Identifier: BSD-3-Clause
-# Generated from qhttpsocketengine.pro.
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qhttpsocketengine LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
if(NOT QT_FEATURE_private_tests)
return()
@@ -17,17 +21,12 @@ qt_internal_add_test(tst_qhttpsocketengine
LIBRARIES
Qt::CorePrivate
Qt::NetworkPrivate
- QT_TEST_SERVER_LIST "squid" "danted" "cyrus" "apache2" # special case
+ QT_TEST_SERVER_LIST "squid" "danted" "cyrus" "apache2"
)
-#### Keys ignored in scope 1:.:.:qhttpsocketengine.pro:<TRUE>:
-# MOC_DIR = "tmp"
-# _REQUIREMENTS = "qtConfig(private_tests)"
-
## Scopes:
#####################################################################
-#### Keys ignored in scope 2:.:.:qhttpsocketengine.pro:LINUX:
# QT_TEST_SERVER_LIST = "squid" "danted" "cyrus" "apache2"
qt_internal_extend_target(tst_qhttpsocketengine CONDITION WIN32
diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 63bd17f130..a52099b5b4 100644
--- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 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 <QtTest/QTest>
@@ -18,6 +18,8 @@
#include "../../../network-settings.h"
+using namespace std::chrono_literals;
+
class tst_QHttpSocketEngine : public QObject
{
Q_OBJECT
@@ -83,9 +85,9 @@ public slots:
int idx = client->property("dataTransmitionIdx").toInt();
if (receivedData.contains("\r\n\r\n") ||
receivedData.contains("\n\n")) {
- if (idx < dataToTransmit.length())
+ if (idx < dataToTransmit.size())
client->write(dataToTransmit.at(idx++));
- if (idx == dataToTransmit.length()) {
+ if (idx == dataToTransmit.size()) {
client->disconnectFromHost();
disconnect(client, 0, this, 0);
client = 0;
@@ -323,7 +325,7 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates()
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::socksProxyServerName()), 8088));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
- if (socketDevice.waitForWrite(30000)) {
+ if (socketDevice.waitForWrite(30s)) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState ||
socketDevice.state() == QAbstractSocket::UnconnectedState);
} else {