From 22e96ca50d5f731fa7a152b934044f0637676429 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Tue, 10 Jan 2023 13:32:01 +0100 Subject: [PATCH] Use consistent collation testability criteria in corelib/text tst_qstringapisymmetry needs to use the same collation testability criteria as tst_qcollator, that is, the locales that may be tested without ICU and not on Mac nor Windows are only the system locale and C locale. Task-number: QTBUG-109954 Change-Id: I69f19ae28b3a16b3827c1eee62ae59fcfdf45209 Reviewed-by: Thiago Macieira --- .../text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 4362ef048b..378ca31e8a 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -1482,8 +1482,9 @@ void tst_QStringApiSymmetry::localeAwareCompare_data() return false; }; #else - // Otherwise, trust that setlocale() reconfigures QString::localeAwareCompare(): - const auto canTest = [](const char *) { return true; }; + const auto canTest = [](const char *wanted) { + return QLocale(wanted) == QLocale::c() || QLocale(wanted) == QLocale::system().collation(); + }; #endif // Update tailpiece's max-value for this if you add a new locale group int countGroups = 0;