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 <thiago.macieira@intel.com>
This commit is contained in:
Mikolaj Boc 2023-01-10 13:32:01 +01:00 committed by Mikołaj Boc
parent 4411406d97
commit 22e96ca50d

View File

@ -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;