summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-04-23 22:43:18 -0300
committerThiago Macieira <thiago.macieira@intel.com>2017-04-24 19:29:57 +0000
commit21dd5d314a75c09250448e5d59dfb9af88c0f7d5 (patch)
tree313390696b105640688f47abe1d169a75dbcc2de /tests/auto/corelib/io
parentfbb485d4f6985643b27da3cc6c5b5f960c32e74d (diff)
QUrl: fix IDN whitelist checking when the TLD is in Unicode
The whitelist is kept in ACE form, so if the TLD came in Unicode, we need to run ToASCII before we can check the whitelist. This is slightly inefficient because we'll run the same operation later in this domain. Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
index f5835ec5f4..766338e4f8 100644
--- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
+++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
@@ -670,6 +670,14 @@ void tst_QUrlInternal::ace_testsuite()
QCOMPARE(QUrl::fromAce(domain.toLatin1()), fromace + suffix);
QCOMPARE(QUrl::fromAce(QUrl::toAce(domain)), unicode + suffix);
+ QUrl u;
+ u.setHost(domain);
+ QVERIFY(u.isValid());
+ QCOMPARE(u.host(), unicode + suffix);
+ QCOMPARE(u.host(QUrl::EncodeUnicode), toace + suffix);
+ QCOMPARE(u.toEncoded(), "//" + toace.toLatin1() + suffix);
+ QCOMPARE(u.toDisplayString(), "//" + unicode + suffix);
+
domain = in + (suffix ? ".troll.No" : "");
QCOMPARE(QString::fromLatin1(QUrl::toAce(domain)), toace + suffix);
if (fromace != ".")