summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-31 17:34:10 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-31 17:34:10 (GMT)
commit0d411622521a89c04a416e2aaf3da44b6015b183 (patch)
tree51e61cea6b56b40d359a8914f59bf3297a5e0d3e /tests/auto/qnetworkreply
parent3b65bb32fda7e34373b64f416ea92a3fa6eb266c (diff)
parent20cc50a21eb5841b3a3e8546877e805f5a4df528 (diff)
downloadQt-0d411622521a89c04a416e2aaf3da44b6015b183.zip
Qt-0d411622521a89c04a416e2aaf3da44b6015b183.tar.gz
Qt-0d411622521a89c04a416e2aaf3da44b6015b183.tar.bz2
Merge branch '4.5' into 4.6
Diffstat (limited to 'tests/auto/qnetworkreply')
-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 52e967f..a223d1c 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -1366,8 +1366,10 @@ void tst_QNetworkReply::getFromHttp()
QCOMPARE(reply->url(), request.url());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
-
- QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size());
+ QCOMPARE(reply->size(), reference.size());
+ // only compare when the header is set.
+ if (reply->header(QNetworkRequest::ContentLengthHeader).isValid())
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size());
QCOMPARE(reply->readAll(), reference.readAll());
}