summaryrefslogtreecommitdiffstats
path: root/tests/auto/qhostinfo/tst_qhostinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qhostinfo/tst_qhostinfo.cpp')
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index 93c08cd..2fa5e76 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -197,13 +197,19 @@ tst_QHostInfo::~tst_QHostInfo()
void tst_QHostInfo::initTestCase()
{
#ifndef QT_NO_BEARERMANAGEMENT
- //start the default network
netConfMan = new QNetworkConfigurationManager(this);
+ netConfMan->updateConfigurations();
+ connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
networkConfiguration = netConfMan->defaultConfiguration();
- networkSession.reset(new QNetworkSession(networkConfiguration));
- if (!networkSession->isOpen()) {
- networkSession->open();
- QVERIFY(networkSession->waitForOpened(30000));
+ if (networkConfiguration.isValid()) {
+ networkSession.reset(new QNetworkSession(networkConfiguration));
+ if (!networkSession->isOpen()) {
+ networkSession->open();
+ QVERIFY(networkSession->waitForOpened(30000));
+ }
+ } else {
+ QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired));
}
#endif