From fd89f9255d7965421a39a9089bb1d983264aff6f Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 7 Oct 2009 12:10:52 +0200 Subject: QUrl autotest additions Add autotest which actually passes, the problem (in kurltest) was the underscore in the hostname. Rename ok_hostname to bad_hostname in the error test, for clarity. Merge-request: 1710 Reviewed-by: Thiago Macieira --- tests/auto/qurl/tst_qurl.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 8856792..026c30e 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -2624,6 +2624,13 @@ void tst_QUrl::tolerantParser() //QCOMPARE(tsdgeosQUrl.toEncoded(), tsdgeosExpected); // unusable output from qtestlib... QCOMPARE(QString(tsdgeosQUrl.toEncoded()), QString(tsdgeosExpected)); } + + { + QUrl url; + url.setUrl("http://strange@hostname/", QUrl::TolerantMode); + QVERIFY(url.isValid()); + QCOMPARE(QString(url.toEncoded()), QString("http://strange%3Cusername%3E@hostname/")); + } } void tst_QUrl::correctEncodedMistakes_data() @@ -3594,9 +3601,9 @@ void tst_QUrl::setAuthority() void tst_QUrl::errorString() { - QUrl u = QUrl::fromEncoded("http://strange@ok_hostname/", QUrl::StrictMode); + QUrl u = QUrl::fromEncoded("http://strange@bad_hostname/", QUrl::StrictMode); QVERIFY(!u.isValid()); - QString errorString = "Invalid URL \"http://strange@ok_hostname/\": " + QString errorString = "Invalid URL \"http://strange@bad_hostname/\": " "error at position 14: expected end of URL, but found '<'"; QCOMPARE(u.errorString(), errorString); -- cgit v0.12