QNetworkInterface auto test: do not abort without session
... but only if the QNetworkConfiguration manager requires one. Change-Id: I1c69c43438f1df9080d207c8598a42201f759c5b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
parent
d0ad02a766
commit
b96e8ff1d2
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user