summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-13 16:32:58 +0100
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-26 14:16:18 +0200
commit8bcf0f55346a52336a925239cbb9a0305357a070 (patch)
treec922e8a6fef25540345f8c25ccf5110e79861ce3 /tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
parent785905a1f4b46f7278653e2e50604f23d359a848 (diff)
Fix instability in QNetworkConfigurationManager autotest
QThread::isFinished() can return false after the finished() signal is emitted, so test the event loop's timeout() function instead. Don't compare prescan configurations, as these may be cached by the OS. It was causing the test to fail on linux if run before any other network test. Reviewed-by: mread (cherry picked from commit e2320ec17446dc6e851fcf4ea2d998177b0d8049) Change-Id: I35d67294871a35e2e63619f4acb0c3c32caa5eea Reviewed-on: http://codereview.qt.nokia.com/137 Reviewed-by: Markus Goetz
Diffstat (limited to 'tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp')
-rw-r--r--tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index 2b11219aa4..d29ef77347 100644
--- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -357,7 +357,7 @@ void tst_QNetworkConfigurationManager::usedInThread()
connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
thread.start();
QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread
- QVERIFY(thread.isFinished());
+ QVERIFY(!QTestEventLoop::instance().timeout());
qDebug() << "prescan:" << thread.preScanConfigs.count();
qDebug() << "postscan:" << thread.configs.count();
@@ -368,7 +368,9 @@ void tst_QNetworkConfigurationManager::usedInThread()
QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations();
QCOMPARE(thread.configs, configs);
- QCOMPARE(thread.preScanConfigs, preScanConfigs);
+ //Don't compare pre scan configs, because these may be cached and therefore give different results
+ //which makes the test unstable. The post scan results should have all configurations every time
+ //QCOMPARE(thread.preScanConfigs, preScanConfigs);
#endif
}