summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-05-19 13:08:16 +0200
committerNorwegian Rock Cat <qt-info@nokia.com>2009-05-19 13:14:39 +0200
commit8413073fe3946ed37f6424f179898af63767f060 (patch)
tree1c01811fe2233dae2236f3ff7893442b4c28f35e /tests
parent41ba7d4a000181607004d450a8130be902a42274 (diff)
Don't "hope" that a connection gets picked up; do it right!
While downloadProgress and uploadProgress both work on local files. There still may be a delay before the connection is actually picked up. This usually is caught by the processEvents(), but could be missed. Therefore, do a wait if we don't have any pending connections and work in ALL cases. Reviewed-by: Markus Goetz
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index bb199b9074..d651ce58b4 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -2637,7 +2637,8 @@ void tst_QNetworkReply::downloadProgress()
QVERIFY(spy.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QCOMPARE(spy.count(), 0);
@@ -2691,7 +2692,8 @@ void tst_QNetworkReply::uploadProgress()
QVERIFY(finished.isValid());
QCoreApplication::instance()->processEvents();
- server.waitForNewConnection(0); // ignore result, since processEvents may have got it
+ if (!server.hasPendingConnections())
+ server.waitForNewConnection(1000);
QVERIFY(server.hasPendingConnections());
QTcpSocket *receiver = server.nextPendingConnection();