diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-12-20 10:27:38 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-12-20 14:16:31 +0100 |
commit | 78db5cb6439070f43422cbda3a562b46c8fc5cf9 (patch) | |
tree | 465f5251450d1e9b36c5061d12e08c087dcbfd56 /tests/auto/corelib/text/qbytearray | |
parent | eda4049a0142029c192e1690bafffbb98ee4ff99 (diff) |
tst_QByteArray/tst_QString: use new QtMiscUtils::toAsciiUpper()
... in lieu of <cctype>'s toupper(), which is locale-dependent, and
out-of-line.
The code doesn't run into the toupper(i) issue in the Türkiye locale,
because we don't run tests in that locale and because 'i' is not a
valid format specifier, but don't let the next reader of the code
guess when the use of toAsciiUpper() provides unambiguous guidance.
Task-number: QTBUG-109235
Pick-to: 6.5
Change-Id: I8988f5190441e1ae5cb57370952cda70ca6bb658
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qbytearray')
-rw-r--r-- | tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp index 34bee7bce8..842f5826ea 100644 --- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp @@ -1256,7 +1256,7 @@ void tst_QByteArray::number_double_data() QTest::addRow("%s, format '%c', precision %d", title, datum.f, datum.p) << datum.d << datum.f << datum.p << ba; if (datum.f != 'f') { // Also test uppercase format - datum.f = toupper(datum.f); + datum.f = QtMiscUtils::toAsciiUpper(datum.f); QByteArray upper = ba.toUpper(); QByteArray upperTitle = QByteArray(title); if (!datum.optTitle.isEmpty()) |