summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qurl/tst_qurl.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-08-21 02:32:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-08-21 02:32:50 +0200
commit5a03b75c50b2e34552c7ec3e1e15e7b2a0128bf7 (patch)
tree88e05cd6150e0b3cda4e8716668082c655007fb8 /tests/auto/corelib/io/qurl/tst_qurl.cpp
parent0e7724079f1eae283714ae12769d1372b8f85659 (diff)
parent6553921dd537e416da2f4d1441ab6d63059cda60 (diff)
Merge dev into 5.12
Diffstat (limited to 'tests/auto/corelib/io/qurl/tst_qurl.cpp')
-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()