Skip to content

Commit

Permalink
Avoid busy wait in qnetworkreply test
Browse files Browse the repository at this point in the history
Change-Id: Ie45d298cbb2ec3854d3ca3d416b9ebeff6d363f1
Reviewed-by: Timur Pocheptsov <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
nierob committed Jul 13, 2016
1 parent 972580a commit aeb64c3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6340,17 +6340,7 @@ void tst_QNetworkReply::getAndThenDeleteObject()
reply->setReadBufferSize(1);
reply->setParent((QObject*)0); // must be 0 because else it is the manager

QTime stopWatch;
stopWatch.start();
forever {
QCoreApplication::instance()->processEvents();
if (reply->bytesAvailable())
break;
if (stopWatch.elapsed() >= 30000)
break;
}

QVERIFY(reply->bytesAvailable());
QTRY_VERIFY_WITH_TIMEOUT(reply->bytesAvailable(), 30000);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
QVERIFY(!reply->isFinished()); // must not be finished

Expand Down

0 comments on commit aeb64c3

Please sign in to comment.