From 50a5ef9945ae9c2ccb869a5b22f3a44460bdd3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 30 Mar 2022 17:33:07 +0200 Subject: [PATCH] tst_QIODevice::unget() without network: skip only the affected part Instead of QSKIPing the whole test, ignoring what was already tested Change-Id: Iced928ce1bce92b447c8698a9942973cb78b6c15 Reviewed-by: Edward Welbourne --- tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index f6c230714a..28e39c6369 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -276,12 +276,15 @@ void tst_QIODevice::unget() lineResult = "ZXCV"; } else { #ifdef QT_TEST_SERVER - if (!QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80)) - QSKIP("No network test server available"); + const bool hasNetworkServer = + QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80); #else - if (!QtNetworkSettings::verifyTestNetworkSettings()) - QSKIP("No network test server available"); + const bool hasNetworkServer = QtNetworkSettings::verifyTestNetworkSettings(); #endif + if (!hasNetworkServer) { + qInfo("No network test server: skipping QTcpSocket part of test."); + continue; + } socket.connectToHost(QtNetworkSettings::httpServerName(), 80); socket.write("GET / HTTP/1.0\r\n\r\n"); QVERIFY(socket.waitForReadyRead());