summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-08-17 10:02:55 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-08-17 12:22:55 +0000
commitae5476eadcd718a11949d98290ea50936d2ba95e (patch)
treef47c0e22ddb63efca457db2eb5263081ce40fcc8 /tests
parent52d4a2976fd7edaf68d697bb1f5cb379cb1739cc (diff)
parent8842d9d1e6c0286922bf18357ca30c146d692316 (diff)
Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 7615ad4586..1aa8984b70 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -2068,6 +2068,21 @@ void tst_QUrl::isValid()
}
{
+ QUrl url = QUrl::fromEncoded("foo://%f0%9f%93%99.example.la/g");
+ QVERIFY(!url.isValid());
+ QVERIFY(url.toString().isEmpty());
+ QCOMPARE(url.path(), QString("/g"));
+ url.setHost("%f0%9f%93%99.example.la/");
+ QVERIFY(!url.isValid());
+ QVERIFY(url.toString().isEmpty());
+ url.setHost("\xf0\x9f\x93\x99.example.la/");
+ QVERIFY(!url.isValid());
+ QVERIFY(url.toString().isEmpty());
+ QVERIFY2(url.errorString().contains("Invalid hostname"),
+ qPrintable(url.errorString()));
+ }
+
+ {
QUrl url("http://example.com");
QVERIFY(url.isValid());
QVERIFY(!url.toString().isEmpty());
@@ -2798,7 +2813,9 @@ void tst_QUrl::hosts()
{
QFETCH(QString, url);
- QTEST(QUrl(url).host(), "host");
+ QUrl u(url);
+ QTEST(u.host(), "host");
+ QVERIFY(u.isEmpty() || u.isValid());
}
void tst_QUrl::hostFlags_data()