diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-08-24 14:53:43 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-08-25 07:59:28 +0000 |
commit | 06c7d67e132e62bfe45b5e2f90c0516ad0a291b0 (patch) | |
tree | 2c160251ddd418b1c5d0e15335d5262c556fc346 /tests/auto/network/access | |
parent | 32fbcf71eef42a5f5f08400b469baddb1fcba10a (diff) |
tst_qnetworkreply: linearise a succession of checks
Restructure an if { if/else} else chain so that it reads more logically.
Change-Id: I0d9a68451147d2b7e6a6d01cf7bee1a64b9902a7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'tests/auto/network/access')
-rw-r--r-- | tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index e3dd39b977..304b70f34b 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1422,14 +1422,12 @@ static QByteArray msgWaitForFinished(QNetworkReplyPtr &reply) QString result; QDebug debug(&result); debug << reply->url(); - if (reply->isFinished()) { - if (reply->error() == QNetworkReply::NoError) - debug << "finished."; - else - debug << "failed: #" << reply->error() << reply->errorString(); - } else { + if (!reply->isFinished()) debug << "timed out."; - } + else if (reply->error() == QNetworkReply::NoError) + debug << "finished."; + else + debug << "failed: #" << reply->error() << reply->errorString(); return result.toLocal8Bit(); } |