From 1f20606fa3aee1e6d152a6f7203ef1fea6ade0b7 Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Wed, 4 Aug 2021 14:04:10 +0200 Subject: 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 Reviewed-by: Edward Welbourne --- tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto') 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)); } -- cgit v1.2.3