diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-04 10:00:47 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-04 10:00:47 (GMT) |
commit | 9fdee69ef3d08f37a2a4f5daceb4606aa5c7ae9b (patch) | |
tree | fff4af9c85f88f1665bc6818646e98b55d663f6b /tests/auto | |
parent | 8f617afa01d1bd9f238c72efab7174fb9336651a (diff) | |
parent | 1db1c895259fba1813a2d970d2334a6b35ba4f5d (diff) | |
download | Qt-9fdee69ef3d08f37a2a4f5daceb4606aa5c7ae9b.zip Qt-9fdee69ef3d08f37a2a4f5daceb4606aa5c7ae9b.tar.gz Qt-9fdee69ef3d08f37a2a4f5daceb4606aa5c7ae9b.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
QNAM HTTP: Fix bug with explicitly zero-length compressed responses.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 81278b6..d9285c8 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -329,6 +329,8 @@ private Q_SLOTS: void qtbug15311doubleContentLength(); + void qtbug18232gzipContentLengthZero(); + void synchronousRequest_data(); void synchronousRequest(); void synchronousRequestSslFailure(); @@ -5217,6 +5219,25 @@ void tst_QNetworkReply::qtbug15311doubleContentLength() QCOMPARE(reply->readAll(), QByteArray("ABC")); } +void tst_QNetworkReply::qtbug18232gzipContentLengthZero() +{ + QByteArray response("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 0\r\n\r\n"); + MiniHttpServer server(response); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->size(), qint64(0)); + QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(0)); + QCOMPARE(reply->readAll(), QByteArray()); +} + void tst_QNetworkReply::synchronousRequest_data() { QTest::addColumn<QUrl>("url"); |