summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-04 14:04:10 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-08-06 17:00:22 +0200
commit1f20606fa3aee1e6d152a6f7203ef1fea6ade0b7 (patch)
treee0992b6e3058af861bb47bfa86c6b99ed9ba6df2 /tests/auto/corelib/io
parent7d86cf02c1f3341056ea9463e93ad336e0e63a52 (diff)
tst_qurlinternal: Add a test for Punycode handling of non-BMP codepoints
Use U+102F7 as an example. The current code is not able to handle conversion of Unicode codepoints outside BMP correctly, so mark the test as expected failure. Task-number: QTBUG-95577 Pick-to: 6.2 Change-Id: Ifd50cf306bce4940f84cb412de148eac952e6c09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
index 7fbfa10bfa..f9876fc12e 100644
--- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
+++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
@@ -231,6 +231,9 @@ void tst_QUrlInternal::idna_testsuite_data()
QTest::newRow("Russian (Cyrillic)") << 28 << char16array(d20)
<< QByteArray(IDNA_ACE_PREFIX "b1abfaaepdrnnbgefbadotcwatmq2g4l")
<< 0 << 0 << IDNA_SUCCESS << IDNA_SUCCESS;
+
+ char16_t d21[] = { 0xd800, 0xdef7 };
+ QTest::newRow("U+102F7") << 2 << char16array(d21) << QByteArray(IDNA_ACE_PREFIX "r97c");
}
#endif
@@ -243,6 +246,7 @@ void tst_QUrlInternal::idna_testsuite()
QString result;
qt_punycodeEncoder(QStringView{unicode.points, numchars}, &result);
+ QEXPECT_FAIL("U+102F7", "QTBUG-95577: Non-BMP handling is broken", Continue);
QCOMPARE(result.toLatin1(), punycode);
QCOMPARE(qt_punycodeDecoder(result), QString::fromUtf16(unicode.points, numchars));
}