qt5base-lts/tests/auto/corelib/serialization
Thiago Macieira 58bea7f3a2 QCborStreamReader::next: don't allocate too much memory in a QBA
Because CBOR strings are encoded in UTF-8, it's possible that the string
that won't fit a QString in UTF-16 would still fit QByteArray in UTF-8
(e.g., anything US-ASCII and most Latin text).

The previous solution was an improvement because we used to read into a
QByteArray then convert the QByteArray to QString, thus using 3x the
amount of memory (1x in QByteArray, 2x in QString). The previous commit
skipped the middle allocation and made the regular readString() function
do the decoding either directly on source memory or by reading in small
chunks (16 kB).

Future improvement for Qt 6.1: add readStringChunk(char16_t *, qsizetype)
so we can do the validation / skipping at O(1) memory.

Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd1645458c655cc566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-12-07 22:54:39 +00:00
..
json Test conversion of ulonglong variant to JSON 2020-11-20 14:31:49 +01:00
qcborstreamreader QCborStreamReader::next: don't allocate too much memory in a QBA 2020-12-07 22:54:39 +00:00
qcborstreamwriter Update tst_qcborstreamwriter to use QMetaType 2020-10-30 22:18:21 +01:00
qcborvalue QCborValue: avoid allocating result if data is insufficient 2020-12-06 07:51:19 +00:00
qcborvalue_json Deprecate QVariant::Type 2020-10-23 09:58:57 +02:00
qdatastream QChar: make construction from integral explicit 2020-11-15 14:41:05 +01:00
qdatastream_core_pixmap CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qtextstream Android: blacklist a list of failing tests for android 2020-11-04 12:27:49 +02:00
qxmlstream Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
cborlargedatavalidation.cpp QCborStreamReader::next: don't allocate too much memory in a QBA 2020-12-07 22:54:39 +00:00
CMakeLists.txt Android: exclude tests crashing at start 2020-11-16 13:35:44 +02:00
serialization.pro Android: exclude tests crashing at start 2020-11-16 13:35:44 +02:00