From a071bd674acd24f0d853f0d58e8d5652cb102553 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Mon, 9 Jan 2023 16:05:48 +0100 Subject: [PATCH] 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 --- tests/auto/corelib/text/qcollator/tst_qcollator.cpp | 6 +++--- 1 file 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