diff options
author | Liang Qi <liang.qi@qt.io> | 2020-02-13 09:14:09 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-02-13 18:31:40 +0100 |
commit | 6b2535ea15cdbdb2355416b604f072fc13ff36b2 (patch) | |
tree | 4bf1560bab77c8b315850c5337ba31a0ea87b5f0 /tests/auto/corelib/text | |
parent | 54c2cebabdda0280b8443c6947b6fee02445e138 (diff) | |
parent | 67491e2df5357706dbf88ddaf1f030ff095b4528 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
examples/widgets/graphicsview/boxes/scene.h
src/corelib/Qt5CoreMacros.cmake
src/corelib/Qt6CoreMacros.cmake
src/network/ssl/qsslsocket.cpp
src/network/ssl/qsslsocket.h
src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
src/testlib/CMakeLists.txt
src/testlib/.prev_CMakeLists.txt
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.
Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
Diffstat (limited to 'tests/auto/corelib/text')
3 files changed, 192 insertions, 19 deletions
diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 2ae9c6e159..6806aa09b5 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -105,6 +105,8 @@ void tst_QCollator::compare_data() QTest::newRow("english6") << QString("en_US") << QString("test 9") << QString("test_19") << -1 << -1 << true << true << -1; QTest::newRow("english7") << QString("en_US") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("english8") << QString("en_US") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("en-empty-word") << QString("en_US") << QString() << QString("non-empty") << -1 << -1 << false << true << -1; + QTest::newRow("en-empty-number") << QString("en_US") << QString() << QString("42") << -1 << -1 << true << true << -1; /* In Swedish, a with ring above (E5) comes before a with @@ -119,6 +121,8 @@ void tst_QCollator::compare_data() QTest::newRow("swedish6") << QString("sv_SE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("swedish7") << QString("sv_SE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("swedish8") << QString("sv_SE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("sv-empty-word") << QString("sv_SE") << QString() << QString("mett") << -1 << -1 << false << true << -1; + QTest::newRow("sv-empty-number") << QString("sv_SE") << QString() << QString("42") << -1 << -1 << true << true << -1; /* @@ -133,6 +137,8 @@ void tst_QCollator::compare_data() QTest::newRow("norwegian6") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("norwegian7") << QString("no_NO") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("norwegian8") << QString("no_NO") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("nb-empty-word") << QString("nb_NO") << QString() << QString("mett") << -1 << -1 << false << true << -1; + QTest::newRow("nb-empty-number") << QString("nb_NO") << QString() << QString("42") << -1 << -1 << true << true << -1; /* In German, z comes *after* a with diaresis (E4), @@ -151,6 +157,8 @@ void tst_QCollator::compare_data() QTest::newRow("german11") << QString("de_DE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("german12") << QString("de_DE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("german13") << QString("de_DE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("de-empty-word") << QString("de_DE") << QString() << QString("satt") << -1 << -1 << false << true << -1; + QTest::newRow("de-empty-number") << QString("de_DE") << QString() << QString("42") << -1 << -1 << true << true << -1; /* French sorting of e and e with acute accent @@ -163,11 +171,15 @@ void tst_QCollator::compare_data() QTest::newRow("french6") << QString("fr_FR") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("french7") << QString("fr_FR") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("french8") << QString("fr_FR") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("fr-empty-word") << QString("fr_FR") << QString() << QString("plein") << -1 << -1 << false << true << -1; + QTest::newRow("fr-empty-number") << QString("fr_FR") << QString() << QString("42") << -1 << -1 << true << true << -1; // C locale: case sensitive [A-Z] < [a-z] but case insensitive [Aa] < [Bb] <...< [Zz] const QString C = QStringLiteral("C"); QTest::newRow("C:ABBA:AaaA") << C << QStringLiteral("ABBA") << QStringLiteral("AaaA") << -1 << 1 << false << false << 1; QTest::newRow("C:AZa:aAZ") << C << QStringLiteral("AZa") << QStringLiteral("aAZ") << -1 << 1 << false << false << 1; + QTest::newRow("C-empty-word") << QString(C) << QString() << QString("non-empty") << -1 << -1 << false << true << -1; + QTest::newRow("C-empty-number") << QString(C) << QString() << QString("42") << -1 << -1 << true << true << -1; } void tst_QCollator::compare() diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index f19b66be37..e4144a376e 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1887,14 +1887,16 @@ void tst_QLocale::toDateTime() // Format number string according to system locale settings. // Expected in format is US "1,234.56". -QString systemLocaleFormatNumber(const QString &numberString) +QString systemLocaleFormatNumber(QString &&numberString) { QLocale locale = QLocale::system(); - QString numberStringCopy = numberString; - return numberStringCopy.replace(QChar(','), QChar('G')) - .replace(QChar('.'), QChar('D')) - .replace(QChar('G'), locale.groupSeparator()) - .replace(QChar('D'), locale.decimalPoint()); + QString numberStringMunged = + numberString.replace(QChar(','), QChar('G')).replace(QChar('.'), QChar('D')); + if (locale.numberOptions() & QLocale::OmitGroupSeparator) + numberStringMunged.remove(QLatin1Char('G')); + else + numberStringMunged.replace(QChar('G'), locale.groupSeparator()); + return numberStringMunged.replace(QChar('D'), locale.decimalPoint()); } void tst_QLocale::macDefaultLocale() @@ -1917,12 +1919,14 @@ void tst_QLocale::macDefaultLocale() // independently of the locale. Verify that they have one of the // allowed values and are not the same. QVERIFY(locale.decimalPoint() == QChar('.') || locale.decimalPoint() == QChar(',')); - QVERIFY(locale.groupSeparator() == QChar(',') - || locale.groupSeparator() == QChar('.') - || locale.groupSeparator() == QChar('\xA0') // no-breaking space - || locale.groupSeparator() == QChar('\'') - || locale.groupSeparator() == QChar()); - QVERIFY(locale.decimalPoint() != locale.groupSeparator()); + if (!(locale.numberOptions() & QLocale::OmitGroupSeparator)) { + QVERIFY(locale.groupSeparator() == QChar(',') + || locale.groupSeparator() == QChar('.') + || locale.groupSeparator() == QChar('\xA0') // no-breaking space + || locale.groupSeparator() == QChar('\'') + || locale.groupSeparator() == QChar()); + QVERIFY(locale.decimalPoint() != locale.groupSeparator()); + } // make sure we are using the system to parse them QCOMPARE(locale.toString(1234.56), systemLocaleFormatNumber(QString("1,234.56"))); @@ -2056,6 +2060,8 @@ void tst_QLocale::windowsDefaultLocale() setWinLocaleInfo(LOCALE_SLONGDATE, longDateFormat); const QString shortTimeFormat = QStringLiteral("h^m^s"); setWinLocaleInfo(LOCALE_SSHORTTIME, shortTimeFormat); + const QString longTimeFormat = QStringLiteral("HH%mm%ss"); + setWinLocaleInfo(LOCALE_STIMEFORMAT, longTimeFormat); QSystemLocale dummy; // to provoke a refresh of the system locale QLocale locale = QLocale::system(); @@ -2069,7 +2075,7 @@ void tst_QLocale::windowsDefaultLocale() QCOMPARE(locale.dateTimeFormat(QLocale::ShortFormat), shortDateFormat + QLatin1Char(' ') + shortTimeFormat); const QString expectedLongDateTimeFormat - = longDateFormat + QLatin1Char(' ') + QStringLiteral("h:mm:ss AP"); + = longDateFormat + QLatin1Char(' ') + longTimeFormat; QCOMPARE(locale.dateTimeFormat(QLocale::LongFormat), expectedLongDateTimeFormat); // make sure we are using the system to parse them @@ -2083,7 +2089,7 @@ void tst_QLocale::windowsDefaultLocale() QCOMPARE(locale.toString(QTime(1,2,3), QLocale::ShortFormat), expectedFormattedShortTime); QCOMPARE(locale.toString(QTime(1,2,3), QLocale::NarrowFormat), locale.toString(QTime(1,2,3), QLocale::ShortFormat)); - const QString expectedFormattedLongTime = QStringLiteral("1:02:03 AM"); + const QString expectedFormattedLongTime = QStringLiteral("01%02%03"); QCOMPARE(locale.toString(QTime(1,2,3), QLocale::LongFormat), expectedFormattedLongTime); QCOMPARE(locale.toString(QDateTime(QDate(1974, 12, 1), QTime(1,2,3)), QLocale::ShortFormat), QStringLiteral("1*12*1974 ") + expectedFormattedShortTime); @@ -2091,7 +2097,6 @@ void tst_QLocale::windowsDefaultLocale() locale.toString(QDateTime(QDate(1974, 12, 1), QTime(1,2,3)), QLocale::ShortFormat)); QCOMPARE(locale.toString(QDateTime(QDate(1974, 12, 1), QTime(1,2,3)), QLocale::LongFormat), QStringLiteral("1@12@1974 ") + expectedFormattedLongTime); - QCOMPARE(locale.toString(QTime(1,2,3), QLocale::LongFormat), expectedFormattedLongTime); } #endif // Q_OS_WIN but !Q_OS_WINRT diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 24382a2b61..bcf4e73108 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> +** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> ** Copyright (C) 2019 Mail.ru Group. ** Contact: https://www.qt.io/licensing/ ** @@ -80,6 +80,13 @@ MAKE_ALL(const char*, QChar) #undef MAKE_RELOP // END FIXME +static Q_DECL_CONSTEXPR int sign(int i) noexcept +{ + return i < 0 ? -1 : + i > 0 ? +1 : + /*else*/ 0 ; +} + // Return a plain ASCII row name consisting of maximum 16 chars and the // size for data static QByteArray rowName(const QByteArray &data) @@ -162,6 +169,12 @@ private Q_SLOTS: void compare_QStringView_QStringView() { compare_impl<QStringView, QStringView>(); } void compare_QStringView_QLatin1String_data() { compare_data(); } void compare_QStringView_QLatin1String() { compare_impl<QStringView, QLatin1String>(); } +#ifdef NOT_YET_IMPLMENTED + void compare_QStringView_QByteArray_data() { compare_data(); } + void compare_QStringView_QByteArray() { compare_impl<QStringView, QByteArray>(); } + void compare_QStringView_const_char_star_data() { compare_data(); } + void compare_QStringView_const_char_star() { compare_impl<QStringView, const char *>(); } +#endif void compare_QLatin1String_QChar_data() { compare_data(false); } void compare_QLatin1String_QChar() { compare_impl<QLatin1String, QChar>(); } @@ -205,6 +218,111 @@ private Q_SLOTS: //void compare_const_char_star_const_char_star() { compare_impl<const char *, const char *>(); } private: + void member_compare_data(bool hasConceptOfNullAndEmpty=true) { compare_data(hasConceptOfNullAndEmpty); } + template <typename LHS, typename RHS> + void member_compare_impl() const; + +private Q_SLOTS: + // test all combinations of {QChar, QStringRef, QString, QStringView, QLatin1String, QByteArray, const char*} +#ifdef NOT_YET_IMPLEMENTED // probably never will be - what's the point of QChar::compare(QStringView)? + void member_compare_QChar_QChar_data() { member_compare_data(false); } + void member_compare_QChar_QChar() { member_compare_impl<QChar, QChar>(); } + void member_compare_QChar_QStringRef_data() { member_compare_data(false); } + void member_compare_QChar_QStringRef() { member_compare_impl<QChar, QStringRef>(); } + void member_compare_QChar_QString_data() { member_compare_data(false); } + void member_compare_QChar_QString() { member_compare_impl<QChar, QString>(); } + void member_compare_QChar_QStringView_data() { member_compare_data(false); } + void member_compare_QChar_QStringView() { member_compare_impl<QChar, QStringView>(); } + void member_compare_QChar_QLatin1String_data() { member_compare_data(false); } + void member_compare_QChar_QLatin1String() { member_compare_impl<QChar, QLatin1String>(); } + void member_compare_QChar_QByteArray_data() { member_compare_data(false); } + void member_compare_QChar_QByteArray() { member_compare_impl<QChar, QByteArray>(); } + void member_compare_QChar_const_char_star_data() { member_compare_data(false); } + void member_compare_QChar_const_char_star() { member_compare_impl<QChar, const char *>(); } +#endif + + void member_compare_QStringRef_QChar_data() { member_compare_data(false); } + void member_compare_QStringRef_QChar() { member_compare_impl<QStringRef, QChar>(); } + void member_compare_QStringRef_QStringRef_data() { member_compare_data(); } + void member_compare_QStringRef_QStringRef() { member_compare_impl<QStringRef, QStringRef>(); } + void member_compare_QStringRef_QString_data() { member_compare_data(); } + void member_compare_QStringRef_QString() { member_compare_impl<QStringRef, QString>(); } +#ifdef NOT_YET_IMPLEMENTED + void member_compare_QStringRef_QStringView_data() { member_compare_data(); } + void member_compare_QStringRef_QStringView() { member_compare_impl<QStringRef, QStringView>(); } +#endif + void member_compare_QStringRef_QLatin1String_data() { member_compare_data(); } + void member_compare_QStringRef_QLatin1String() { member_compare_impl<QStringRef, QLatin1String>(); } + void member_compare_QStringRef_QByteArray_data() { member_compare_data(); } + void member_compare_QStringRef_QByteArray() { member_compare_impl<QStringRef, QByteArray>(); } +#ifdef NOT_YET_IMPLEMENTED + void member_compare_QStringRef_const_char_star_data() { member_compare_data(); } + void member_compare_QStringRef_const_char_star() { member_compare_impl<QStringRef, const char *>(); } +#endif + + void member_compare_QString_QChar_data() { member_compare_data(false); } + void member_compare_QString_QChar() { member_compare_impl<QString, QChar>(); } + void member_compare_QString_QStringRef_data() { member_compare_data(); } + void member_compare_QString_QStringRef() { member_compare_impl<QString, QStringRef>(); } + void member_compare_QString_QString_data() { member_compare_data(); } + void member_compare_QString_QString() { member_compare_impl<QString, QString>(); } + void member_compare_QString_QStringView_data() { member_compare_data(); } + void member_compare_QString_QStringView() { member_compare_impl<QString, QStringView>(); } + void member_compare_QString_QLatin1String_data() { member_compare_data(); } + void member_compare_QString_QLatin1String() { member_compare_impl<QString, QLatin1String>(); } + void member_compare_QString_QByteArray_data() { member_compare_data(); } + void member_compare_QString_QByteArray() { member_compare_impl<QString, QByteArray>(); } + void member_compare_QString_const_char_star_data() { member_compare_data(); } + void member_compare_QString_const_char_star() { member_compare_impl<QString, const char *>(); } + +#ifdef NOT_YET_IMPLEMENTED // QChar doesn't implicitly convert to QStringView + void member_compare_QStringView_QChar_data() { member_compare_data(false); } + void member_compare_QStringView_QChar() { member_compare_impl<QStringView, QChar>(); } +#endif + void member_compare_QStringView_QStringRef_data() { member_compare_data(); } + void member_compare_QStringView_QStringRef() { member_compare_impl<QStringView, QStringRef>(); } + void member_compare_QStringView_QString_data() { member_compare_data(); } + void member_compare_QStringView_QString() { member_compare_impl<QStringView, QString>(); } + void member_compare_QStringView_QStringView_data() { member_compare_data(); } + void member_compare_QStringView_QStringView() { member_compare_impl<QStringView, QStringView>(); } +#ifdef NOT_YET_IMPLEMENTED + void member_compare_QStringView_QLatin1String_data() { member_compare_data(); } + void member_compare_QStringView_QLatin1String() { member_compare_impl<QStringView, QLatin1String>(); } + void member_compare_QStringView_QByteArray_data() { member_compare_data(); } + void member_compare_QStringView_QByteArray() { member_compare_impl<QStringView, QByteArray>(); } + void member_compare_QStringView_const_char_star_data() { member_compare_data(); } + void member_compare_QStringView_const_char_star() { member_compare_impl<QStringView, const char *>(); } + + void member_compare_QLatin1String_QChar_data() { member_compare_data(false); } + void member_compare_QLatin1String_QChar() { member_compare_impl<QLatin1String, QChar>(); } + void member_compare_QLatin1String_QStringRef_data() { member_compare_data(); } + void member_compare_QLatin1String_QStringRef() { member_compare_impl<QLatin1String, QStringRef>(); } + void member_compare_QLatin1String_QString_data() { member_compare_data(); } + void member_compare_QLatin1String_QString() { member_compare_impl<QLatin1String, QString>(); } + void member_compare_QLatin1String_QStringView_data() { member_compare_data(); } + void member_compare_QLatin1String_QStringView() { member_compare_impl<QLatin1String, QStringView>(); } + void member_compare_QLatin1String_QLatin1String_data() { member_compare_data(); } + void member_compare_QLatin1String_QLatin1String() { member_compare_impl<QLatin1String, QLatin1String>(); } + void member_compare_QLatin1String_QByteArray_data() { member_compare_data(); } + void member_compare_QLatin1String_QByteArray() { member_compare_impl<QLatin1String, QByteArray>(); } + void member_compare_QLatin1String_const_char_star_data() { member_compare_data(); } + void member_compare_QLatin1String_const_char_star() { member_compare_impl<QLatin1String, const char *>(); } + + void member_compare_QByteArray_QChar_data() { member_compare_data(false); } + void member_compare_QByteArray_QChar() { member_compare_impl<QByteArray, QChar>(); } + void member_compare_QByteArray_QStringRef_data() { member_compare_data(); } + void member_compare_QByteArray_QStringRef() { member_compare_impl<QByteArray, QStringRef>(); } + void member_compare_QByteArray_QString_data() { member_compare_data(); } + void member_compare_QByteArray_QString() { member_compare_impl<QByteArray, QString>(); } + void member_compare_QByteArray_QLatin1String_data() { member_compare_data(); } + void member_compare_QByteArray_QLatin1String() { member_compare_impl<QByteArray, QLatin1String>(); } +#endif + void member_compare_QByteArray_QByteArray_data() { member_compare_data(); } + void member_compare_QByteArray_QByteArray() { member_compare_impl<QByteArray, QByteArray>(); } + void member_compare_QByteArray_const_char_star_data() { member_compare_data(); } + void member_compare_QByteArray_const_char_star() { member_compare_impl<QByteArray, const char *>(); } + +private: void startsWith_data(bool rhsIsQChar = false); template <typename Haystack, typename Needle> void startsWith_impl() const; @@ -601,7 +719,7 @@ void tst_QStringApiSymmetry::compare_data(bool hasConceptOfNullAndEmpty) QTest::newRow(qUtf8Printable(QLatin1String("'" lhs "' <> '" rhs "': "))) \ << QStringRef(&pinned[0]) << QLatin1String(lhs) \ << QStringRef(&pinned[1]) << QLatin1String(rhs) \ - << qstrcmp(lhs, rhs) << qstricmp(lhs, rhs); \ + << sign(qstrcmp(lhs, rhs)) << sign(qstricmp(lhs, rhs)); \ } while (false) ROW("", "0"); ROW("0", ""); @@ -691,6 +809,44 @@ void tst_QStringApiSymmetry::compare_impl() const #undef CHECK } +template <typename LHS, typename RHS> +void tst_QStringApiSymmetry::member_compare_impl() const +{ + QFETCH(QStringRef, lhsUnicode); + QFETCH(QLatin1String, lhsLatin1); + QFETCH(QStringRef, rhsUnicode); + QFETCH(QLatin1String, rhsLatin1); + QFETCH(const int, caseSensitiveCompareResult); + QFETCH(const int, caseInsensitiveCompareResult); + + const auto lhsU8 = lhsUnicode.toUtf8(); + const auto rhsU8 = rhsUnicode.toUtf8(); + + const auto lhs = make<LHS>(lhsUnicode, lhsLatin1, lhsU8); + const auto rhs = make<RHS>(rhsUnicode, rhsLatin1, rhsU8); + +#define QVERIFY_NOEXCEPT(expr) do { \ + if (has_nothrow_compare<LHS, RHS>::value) {} else \ + QEXPECT_FAIL("", "Qt is missing a nothrow utf8-utf16 comparator", Continue); \ + QVERIFY(noexcept(expr)); } while (0) + + if (std::is_same<LHS, QByteArray>::value || // needs to simply be marked as noexcept + ((std::is_same<LHS, QString>::value || std::is_same<LHS, QStringRef>::value) + && std::is_same<RHS, QChar>::value)) // implict QChar -> QString conversion kills noexcept + QEXPECT_FAIL("", "known issues, will be fixed before 5.14 release", Continue); + QVERIFY_NOEXCEPT(lhs.compare(rhs, Qt::CaseSensitive)); + + QCOMPARE(sign(lhs.compare(rhs)), caseSensitiveCompareResult); + QCOMPARE(sign(lhs.compare(rhs, Qt::CaseSensitive)), caseSensitiveCompareResult); + if (is_utf8_encoded<LHS>::value && is_utf8_encoded<RHS>::value && + caseSensitiveCompareResult != caseInsensitiveCompareResult && + (!QtPrivate::isAscii(lhsUnicode) || !QtPrivate::isAscii(rhsUnicode))) + { + QEXPECT_FAIL("", "Qt is missing a case-insensitive UTF-8/UTF-8 comparator", Continue); + } + QCOMPARE(sign(lhs.compare(rhs, Qt::CaseInsensitive)), caseInsensitiveCompareResult); +} + static QString empty = QLatin1String(""); static QString null; // the tests below rely on the fact that these objects' names match their contents: |