qt5base-lts/tests/auto/corelib/serialization
Thiago Macieira 9a55f40937 QCborStreamReader: avoid allocating result if data is insufficient
By calling the internal readStringChunk() function with a QByteArray
pointer, QCborStreamReader::readByteArray() can now avoid allocating the
resulting buffer until the internals have confirmed that there is
sufficient data in the incoming buffer. As a result, we first detect the
EOF condition before we conclude the payload would have been too big for
QByteArray (validation()) test. Meanwhile, the hugeDeviceValidation()
test ends up with a few conditions where it would have copied 1 GB of
data, so limit that too.

We make a choice of reporting OOM vs DataTooLarge only if QByteArray
fails to allocate in the first place (QByteArray::resize() ->
Q_CHECK_PTR -> qBadAlloc, QtCore is always built with exceptions on).

The QCborValue unit test needed a temporary work around until we apply
the same allocation fix (see next commit).

Pick-to: 5.15 6.0
Fixes: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd164523eeae49cdfe
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-12-06 07:50:57 +00:00
..
json Test conversion of ulonglong variant to JSON 2020-11-20 14:31:49 +01:00
qcborstreamreader QCborStreamReader: avoid allocating result if data is insufficient 2020-12-06 07:50:57 +00:00
qcborstreamwriter Update tst_qcborstreamwriter to use QMetaType 2020-10-30 22:18:21 +01:00
qcborvalue QCborStreamReader: avoid allocating result if data is insufficient 2020-12-06 07:50:57 +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: avoid allocating result if data is insufficient 2020-12-06 07:50:57 +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