summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-01-09 16:05:48 +0100
committerMikolaj Boc <mikolaj.boc@qt.io>2023-01-10 23:25:42 +0100
commita071bd674acd24f0d853f0d58e8d5652cb102553 (patch)
tree7ec488e74a948d203a976b81635734be1300b5d3 /tests/auto/corelib/text
parent7f1d3c09c9620d6aa5c7c94429e0e2a10a82b6d6 (diff)
Correctly determine if posix collator is used in tst_qcollator
qcollator_posix.cpp is included if ICU is not used and the OS is not Win nor macOS. Reflect that fact in tst_qcollator instead of using alternative means which breaks with new platforms that use the posix collator. Task-number: QTBUG-109954 Change-Id: I592500ce9626efbcc9377cecf6641967f978c6da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r--tests/auto/corelib/text/qcollator/tst_qcollator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp
index 0a019404b6..b7b8c0a8ec 100644
--- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp
+++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp
@@ -52,7 +52,7 @@ void tst_QCollator::basics()
// posix implementation supports only C and default locale,
// so update it for Android and INTEGRITY builds
-#if defined(Q_OS_ANDROID) || defined(Q_OS_INTEGRITY)
+#if !QT_CONFIG(icu) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
c3.setLocale(QLocale());
#endif
QCollatorSortKey key1 = c3.sortKey("test");
@@ -87,7 +87,7 @@ void tst_QCollator::moveSemantics()
// test QCollatorSortKey move assignment
// posix implementation supports only C and default locale,
// so update it for Android and INTEGRITY builds
-#if defined(Q_OS_ANDROID) || defined(Q_OS_INTEGRITY)
+#if !QT_CONFIG(icu) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
c1.setLocale(QLocale());
#endif
QCollatorSortKey key1 = c1.sortKey("1");
@@ -264,7 +264,7 @@ void tst_QCollator::compare()
return compared < 0 ? -1 : compared > 0 ? 1 : 0;
};
-#if defined(Q_OS_ANDROID) || defined(Q_OS_INTEGRITY)
+#if !QT_CONFIG(icu) && !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
if (collator.locale() != QLocale::c() && collator.locale() != QLocale::system().collation())
QSKIP("POSIX implementation of collation only supports C and system collation locales");
#endif