summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2009-10-07 10:10:52 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-10-07 10:10:52 (GMT)
commitfd89f9255d7965421a39a9089bb1d983264aff6f (patch)
treec34cb57d6b7ab92f815258e87ab6ed60610af7e1 /tests/auto
parentbb13e2d43c664359aa61fc39c31f75a5c3fb4f5e (diff)
downloadQt-fd89f9255d7965421a39a9089bb1d983264aff6f.zip
Qt-fd89f9255d7965421a39a9089bb1d983264aff6f.tar.gz
Qt-fd89f9255d7965421a39a9089bb1d983264aff6f.tar.bz2
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 <thiago.macieira@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qurl/tst_qurl.cpp11
1 files 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<username>@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<username>@ok_hostname/", QUrl::StrictMode);
+ QUrl u = QUrl::fromEncoded("http://strange<username>@bad_hostname/", QUrl::StrictMode);
QVERIFY(!u.isValid());
- QString errorString = "Invalid URL \"http://strange<username>@ok_hostname/\": "
+ QString errorString = "Invalid URL \"http://strange<username>@bad_hostname/\": "
"error at position 14: expected end of URL, but found '<'";
QCOMPARE(u.errorString(), errorString);