qt5base-lts/tests/auto/corelib/text
Edward Welbourne 78cf89c07d Use checked string iteration in case conversions
The Unicode table code can only be safely called on valid code-points.
So code that calls it must only pass it valid Unicode data. The string
iterator's Unchecked Unchecked methods only provide this guarantee
when the string being iterated is guaranteed to be valid UTF-16; while
client code should only use QString, QStringView and friends on valid
UTF-16 data, we have no way to be sure they have respected that.

So take the few extra cycles to actually check validity in the course
of iterating strings, when the resulting code-points are to be passed
to the Unicode table look-ups. Add tests that case mapping doesn't
access Unicode tables out of range (it'll trigger the new assertion).
Added some comments to qchar.h that helped me understand surrogates.

Change-Id: Iec2c3106bf1a875bdaa1d622f6cf94d7007e281e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 18:15:27 +02:00
..
qbytearray Change QByteArray to handle large arrays 2020-08-27 18:58:20 +02:00
qbytearrayapisymmetry Fix QByteArray::count implementation for longer data 2020-07-09 18:38:33 +02:00
qbytearraylist CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qbytearraymatcher Replace Qt CONSTEXPR defines with constexpr 2020-08-14 15:52:58 +02:00
qbytearrayview Introduce QByteArrayView 2020-07-08 08:45:49 +02:00
qbytedatabuffer QByteDataBuffer: add readPointer functionality using QByteArrayView 2020-08-24 17:44:08 +02:00
qchar QChar: purge deprecated API 2020-07-20 16:06:28 +02:00
qcollator tst_QCollator: avoid an unused variable warning 2020-07-13 12:03:21 +02:00
qlatin1string Port QLatin1String to qsizetype and add narrow-contract substring functions 2020-08-23 10:38:01 +02:00
qlocale Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
qregularexpression Use qsizetype in QRegularExpression 2020-08-28 02:22:10 +02:00
qstring Use checked string iteration in case conversions 2020-08-29 18:15:27 +02:00
qstring_no_cast_from_bytearray CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qstringapisymmetry Add back QByteArray's relational operators taking QString 2020-08-26 14:37:43 +00:00
qstringbuilder Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
qstringconverter tst_QStringConverter: fix some deprecation warnings 2020-08-07 17:44:01 +02:00
qstringiterator CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qstringlist CMake: Regenerate tests with new qt_ prefixed APIs 2020-07-09 09:38:35 +02:00
qstringmatcher Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
qstringtokenizer Use QList instead of QVector in corelib tests 2020-07-07 11:48:45 +02:00
qstringview Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
qtextboundaryfinder Remove QTextCodec dependency from test 2020-05-14 07:50:49 +02:00
.prev_CMakeLists.txt Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
CMakeLists.txt Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00
text.pro Move QStringRef and remains to Qt5Compat 2020-08-20 00:58:13 +02:00