summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-01-10 13:32:01 +0100
committerMikoĊ‚aj Boc <Mikolaj.Boc@qt.io>2023-01-11 08:47:59 +0000
commit22e96ca50d5f731fa7a152b934044f0637676429 (patch)
treef9d4a562dfef1b01abf6c4986acf6a77995e0896 /tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
parent4411406d97250a26d170b7e42c364b67c6e27c34 (diff)
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>
Diffstat (limited to 'tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp')
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp5
1 files 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;