summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-15 05:43:10 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-15 05:43:10 (GMT)
commit96a3848f8f460a39d5bad1e5c78e61857645c28f (patch)
tree1938397954a921ba5733bb22d1b21afe4c9d342b /tests
parentcde72ad73cf2ee31e701e84763c152685493b7c7 (diff)
parent76055d4e4a3023ef6390d85a02688bb11df57284 (diff)
downloadQt-96a3848f8f460a39d5bad1e5c78e61857645c28f.zip
Qt-96a3848f8f460a39d5bad1e5c78e61857645c28f.tar.gz
Qt-96a3848f8f460a39d5bad1e5c78e61857645c28f.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: Ignore double content-length headers Don't pack Harfbuzz structs, this causes unaligned access crashes. qmake vcxproj generator: fix description of custom build tools Minor adjustments to merge-request 915 Implement brush transformations for directfb. Add FreeBSD's certificate bundle to the certificates list. SSL internals: upon error, read all errors from OpenSSL Added an example for QTest::touchEvent to the documentation. Push and pop the thread-default context for the current thread Fix compilation by s/intptr_t/quintptr/
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index a986438..41b3e0a 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -301,6 +301,8 @@ private Q_SLOTS:
void httpWithNoCredentialUsage();
+ void qtbug15311doubleContentLength();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -4724,6 +4726,26 @@ void tst_QNetworkReply::httpWithNoCredentialUsage()
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
+void tst_QNetworkReply::qtbug15311doubleContentLength()
+{
+ QByteArray response("HTTP/1.0 200 OK\r\nContent-Length: 3\r\nServer: bogus\r\nContent-Length: 3\r\n\r\nABC");
+ 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(3));
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(3));
+ QCOMPARE(reply->rawHeader("Content-length"), QByteArray("3, 3"));
+ QCOMPARE(reply->readAll(), QByteArray("ABC"));
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!