summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-08-31 14:46:59 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-08-31 14:51:21 (GMT)
commit9d24605add8daabfa55e1085e71ed47b14ed7d83 (patch)
tree391da3c4b0350cb1bbdf0ad04c53586b7de6fe44 /tests/auto/qnetworkreply
parentb0295e82d08605a5a40803895544e57eeb6c8dc3 (diff)
downloadQt-9d24605add8daabfa55e1085e71ed47b14ed7d83.zip
Qt-9d24605add8daabfa55e1085e71ed47b14ed7d83.tar.gz
Qt-9d24605add8daabfa55e1085e71ed47b14ed7d83.tar.bz2
QNAM HTTP Code: Some tests where failing
ietf.org changed their server to use gzip, therefore our check for the content-length reply header was bogus. Rev-By: Peter Hartmann
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 3216a6a..48a48f4 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -1081,8 +1081,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());
}