From b96e8ff1d237e88190ac2beeaa274e5cbf9d676f Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 8 Mar 2013 17:49:30 +0100 Subject: QNetworkInterface auto test: do not abort without session ... but only if the QNetworkConfiguration manager requires one. Change-Id: I1c69c43438f1df9080d207c8598a42201f759c5b Reviewed-by: Shane Kearns --- .../kernel/qnetworkinterface/tst_qnetworkinterface.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp index 1b64f1dd73..7780b80179 100644 --- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp @@ -91,11 +91,14 @@ void tst_QNetworkInterface::initTestCase() QSKIP("No network test server available"); #ifndef QT_NO_BEARERMANAGEMENT netConfMan = new QNetworkConfigurationManager(this); - networkConfiguration = netConfMan->defaultConfiguration(); - networkSession.reset(new QNetworkSession(networkConfiguration)); - if (!networkSession->isOpen()) { - networkSession->open(); - QVERIFY(networkSession->waitForOpened(30000)); + if (netConfMan->capabilities() + & QNetworkConfigurationManager::NetworkSessionRequired) { + networkConfiguration = netConfMan->defaultConfiguration(); + networkSession.reset(new QNetworkSession(networkConfiguration)); + if (!networkSession->isOpen()) { + networkSession->open(); + QVERIFY(networkSession->waitForOpened(30000)); + } } #endif } -- cgit v1.2.3