summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-10-15 11:42:45 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-10-15 11:43:44 (GMT)
commitb44ca15776227c8d04e88e1c343a87fd6c54fee0 (patch)
tree5da9b12ace8530d0b76671d38d2a880cce4f8704 /tests/auto/qnetworkreply/tst_qnetworkreply.cpp
parentc2f542ee646b8e4bd87e6078dc9c83b661229f41 (diff)
downloadQt-b44ca15776227c8d04e88e1c343a87fd6c54fee0.zip
Qt-b44ca15776227c8d04e88e1c343a87fd6c54fee0.tar.gz
Qt-b44ca15776227c8d04e88e1c343a87fd6c54fee0.tar.bz2
tst_qnetworkreply: New auto test for unreachable IPs
This test fails right now and we should fix the underlying issue :-) Task-number: QT-4155
Diffstat (limited to 'tests/auto/qnetworkreply/tst_qnetworkreply.cpp')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 306b5f8..88714e6 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -291,6 +291,8 @@ private Q_SLOTS:
void qtbug12908compressedHttpReply();
+ void getFromUnreachableIp();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -4301,6 +4303,19 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply()
QCOMPARE(reply->error(), QNetworkReply::NoError);
}
+void tst_QNetworkReply::getFromUnreachableIp()
+{
+ QNetworkAccessManager manager;
+
+ QNetworkRequest request(QUrl("http://255.255.255.255/42/23/narf/narf/narf"));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(5);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QVERIFY(reply->error() != QNetworkReply::NoError);
+}
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()