summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-08-18 12:53:08 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-18 08:05:38 +0200
commit0f1aee99634d2f14f6137d39ecbfea1b17fb6c60 (patch)
tree9ae6eca9cb1344e2120734b61fd67b9898c29058 /tests
parent6e7ad733a48dbf2a7f9e04482993d68f00d8edca (diff)
test: fixed failure of tst_qhostinfo
Doing an async exit of the test event loop is unsafe - it means that a call to exitLoop may be left pending from one testfunction, causing future testfunctions to fail. This in fact was happening for the multipleDifferentLookups testfunction, which was running the event loop for two milliseconds at a time until a certain amount of lookups was done. It was common for the loop to timeout after the lookup had completed but before the async exitLoop had been processed. Make it simple, do a synchronous exitLoop. Change-Id: I2ffe6989bddc091ddd42b218a75f7a8ff160cf53 Reviewed-on: http://codereview.qt.nokia.com/3124 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index 35c8d8d95c..1c7df1bdae 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -611,7 +611,7 @@ void tst_QHostInfo::resultsReady(const QHostInfo &hi)
lookupDone = true;
lookupResults = hi;
lookupsDoneCounter++;
- QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection);
+ QTestEventLoop::instance().exitLoop();
}
void tst_QHostInfo::abortHostLookup()