summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-17 09:08:04 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-17 09:08:06 +0200
commit8842d9d1e6c0286922bf18357ca30c146d692316 (patch)
tree93b78c4f8dcb21275517f94da2ccc4500005e8c2 /tests/auto
parent67352c92761fcb2e2c6a98b24e1bf5f33805cb3a (diff)
parent29778037f8a7b2c86bc4044409b37d5a51a15432 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'tests/auto')
-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()