qt6-bb10/tests/auto/corelib/text
Edward Welbourne cc64959602 Tidy up tst_QString::localeAwareCompare()
It was suppressed unconditionally (albeit in different places and with
different levels of obviousness) almost everywhere, due to inability
to set the system locale in use by the implementation. Several
test-cases used ISO-8859-1 encoding on Q_OS_MAC, where the tests were
all suppressed anyway. A block of no_NO tests was #if 0'd out; and
should, in any case, have been nb_NO. Tests of any locale but en_US
were skipped on Q_OS_WIN because we can't set the locale (but
including the tests of en_US tacitly assumed that's the system
locale). If setlocale() failed, for ICU or DARWIN, the test was
skipped; but we might as well check for this in the _data() to save
repetition.

The test was laboriously going through the sign cases; relocate the
QString::compare() test's sign() function so that we can use it here,
too, and simply QCOMPARE() signs. Introduce a TransientLocale class,
copied from tst_QLocale, to take care of setting and restoring the
locale using setlocale(). Change the locale name to a QByteArray so
that we save having to convert it to one in order to pass it to
setlocale(). Since that changed every _data() row, reformat those rows
in the process - most of them were long lines.

On the systems where we can't set the locale used by the function
being tested, condition each block of tests in the _data() on whether
LC_COLLATE looks like the locale to be tested, and report how a
determined developer at least can (by repeatedly running the test with
different locales set) test all the cases; and we'll attempt the ones
that we can, when one of the relevant locales is in use. If that
leaves us with no tests we can do, QSKIP() in the _data() to avoid an
assert failure for "Test data requested, but no testdata available."

Change-Id: I75709fda8827dcbe74f80c4136042054da6fcb13
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-16 17:42:37 +02:00
..
qbytearray Add more tests for QList/QString/QBA 2021-04-27 14:12:34 +02:00
qbytearrayapisymmetry Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbytearraylist Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbytearraymatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbytearrayview QByteArrayView: add compare 2021-05-20 17:02:38 +02:00
qbytedatabuffer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qchar Hangul composition: use < base + count checks, not <= checks 2021-06-11 13:57:19 +02:00
qcollator Mark variables that might be unused under some configurations 2021-04-11 19:53:43 +02:00
qlatin1string QLatin1String: Add a constructor taking QByteArrayView 2021-06-12 03:08:59 +02:00
qlocale Add .UTF-8 suffixes to locale-names passed to setlocale() 2021-06-11 23:30:09 +02:00
qregularexpression QRegularExpression: add move constructor 2021-01-26 17:20:01 +01:00
qstring Tidy up tst_QString::localeAwareCompare() 2021-06-16 17:42:37 +02:00
qstring_no_cast_from_bytearray Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringapisymmetry String API Symmetry: test for indexOf with large negative offset 2021-06-11 22:04:04 +00:00
qstringbuilder Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringconverter Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringiterator Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringlist Ensure test using setlocale() doesn't leave it permanently changed 2021-06-12 00:03:53 +02:00
qstringmatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringtokenizer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringview Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtextboundaryfinder Unicode: fix the extended grapheme cluster algorithm 2021-04-16 20:31:39 +02:00
CMakeLists.txt Android: blacklist a list of failing tests for android 2020-11-04 12:27:49 +02:00