From 5b013997811063f22853d63809a6581f2a2628ed Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Tue, 17 Aug 2021 16:10:30 +0200 Subject: [PATCH] tst_qurl: Make an invalid URL test compatible with UTS #46 Use U+1F100 DIGIT ZERO FULL STOP instead of U+1F4D9 ORANGE BOOK. The latter is not allowed according to IDNA 2003 rules but is allowed according to UTS #46 rules. The former is disallowed in either case. Task-number: QTBUG-85371 Change-Id: Idc8afef68c26ae0b702a475e5a53592182998a08 Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index dae137cf10..7872ac1d88 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -2145,14 +2145,15 @@ void tst_QUrl::isValid() } { - QUrl url = QUrl::fromEncoded("foo://%f0%9f%93%99.example.la/g"); + // U+1F100 DIGIT ZERO FULL STOP + QUrl url = QUrl::fromEncoded("foo://%f0%9f%84%80.example.la/g"); QVERIFY(!url.isValid()); QVERIFY(url.toString().isEmpty()); QCOMPARE(url.path(), QString("/g")); - url.setHost("%f0%9f%93%99.example.la/"); + url.setHost("%f0%9f%84%80.example.la/"); QVERIFY(!url.isValid()); QVERIFY(url.toString().isEmpty()); - url.setHost("\xf0\x9f\x93\x99.example.la/"); + url.setHost("\xf0\x9f\x84\x80.example.la/"); QVERIFY(!url.isValid()); QVERIFY(url.toString().isEmpty()); QVERIFY2(url.errorString().contains("Invalid hostname"),