diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-15 14:26:41 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-03-16 08:31:04 (GMT) |
commit | dd6c5cad88a56fb3a342fe9d4fc3b113ffe3fd53 (patch) | |
tree | d2a9d7c6762b883c16b8fb42389a4620cbd8d817 /tests | |
parent | 6f814d58036867a28333770bd55f5fe49bb9ac82 (diff) | |
download | Qt-dd6c5cad88a56fb3a342fe9d4fc3b113ffe3fd53.zip Qt-dd6c5cad88a56fb3a342fe9d4fc3b113ffe3fd53.tar.gz Qt-dd6c5cad88a56fb3a342fe9d4fc3b113ffe3fd53.tar.bz2 |
QNetworkReply: Fix canReadLine()
Reviewed-by: Peter Hartmann
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index cafeef0..76e69c5 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -237,6 +237,8 @@ private Q_SLOTS: void lastModifiedHeaderForFile(); void lastModifiedHeaderForHttp(); + void httpCanReadLine(); + void rateControl_data(); void rateControl(); @@ -3315,6 +3317,21 @@ void tst_QNetworkReply::lastModifiedHeaderForHttp() QCOMPARE(header, realDate); } +void tst_QNetworkReply::httpCanReadLine() +{ + QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + + QVERIFY(reply->canReadLine()); + QVERIFY(!reply->readAll().isEmpty()); + QVERIFY(!reply->canReadLine()); +} + void tst_QNetworkReply::rateControl_data() { QTest::addColumn<int>("rate"); |