diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-10-29 12:36:19 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-11-01 22:30:23 +0200 |
commit | 25d807f6292e9918ccdbe06cf7f590f60ecae457 (patch) | |
tree | 211d310c3f80c3cc75fbdffa8312a2be60ef8ebc /tests/auto/corelib | |
parent | 48856934ec5c771aebc497b0b75d0a1a0e6c1b3c (diff) |
Correct qcollator_posix.cpp's check against system locale
The check was made against the default locale but the code calls the
system functions (wcscoll, wcsxfrm, wcscmp) for locale-specific
collation, so should be comparing to the system locale's collation
locale (i.e. LC_COLLATE). Also correct the Android-only check in
tst_QCollator::compare() which duplicated the check but neglected the
C locale, which is also supported (via QString::compare).
Pick-to: 6.2
Change-Id: I48c3237dd6825e2070272ab88d95bdb8cbb9fc37
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/text/qcollator/tst_qcollator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 4935ba9cf2..ce1844f345 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -282,8 +282,8 @@ void tst_QCollator::compare() }; #ifdef Q_OS_ANDROID - if (collator.locale() != QLocale()) - QSKIP("Posix implementation of collation only supports default locale"); + if (collator.locale() != QLocale::c() && collator.locale() != QLocale::system().collation()) + QSKIP("POSIX implementation of collation only supports C and system collation locales"); #endif if (numericMode) |