diff options
Diffstat (limited to 'tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp')
-rw-r--r-- | tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp index eb3b6f911e..d637b1b251 100644 --- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp @@ -60,6 +60,8 @@ private slots: void interfaceFromXXX_data(); void interfaceFromXXX(); void copyInvalidInterface(); +private: + bool hasNetworkServer = false; }; tst_QNetworkInterface::tst_QNetworkInterface() @@ -84,8 +86,11 @@ bool tst_QNetworkInterface::isIPv6Working() void tst_QNetworkInterface::initTestCase() { - if (!QtNetworkSettings::verifyTestNetworkSettings()) - QSKIP("No network test server available"); +#ifdef QT_TEST_SERVER + hasNetworkServer = QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80); +#else + hasNetworkServer = QtNetworkSettings::verifyTestNetworkSettings(); +#endif } void tst_QNetworkInterface::dump() @@ -195,7 +200,8 @@ void tst_QNetworkInterface::localAddress_data() if (ipv6) QTest::newRow("localhost-ipv6") << QHostAddress(QHostAddress::LocalHostIPv6); - QTest::newRow("test-server") << QtNetworkSettings::serverIP(); + if (hasNetworkServer) + QTest::newRow("test-server") << QtNetworkSettings::httpServerIp(); QSet<QHostAddress> added; const QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces(); |