qt5base-lts/tests/auto/corelib/serialization/qdatastream
Eirik Aavitsland f2f040ae1c Improve support for QImages in QDataStream read transactions
QImage's operator>>(QDataStream&) did not set an error mode on the
stream on read failures. That would break QDataStream transactions.
Since the current QImage serialization cannot differentiate between
truncated and corrupted data, we set the ReadPastEnd error as expected
by the transaction system.

Also specify the expected file format on decoding QImage from stream,
to avoid all the format handlers' canRead() being invoked. This is
necessary since some of them may call ungetChar(), which fails when
the stream is in a transaction.

Also add testing of this feature to the QDataStram transaction
autotest. That required a slight rewrite of the fake sequential
QIODevice subclass. The previous implementation had incorrect
behavior of peek(), which is required by QImage decoders.

Task-number: QTBUG-70875
Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-15 07:18:57 +00:00
..
.gitignore Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
datastream.q42 Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
qdatastream.pro Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
testdata.qrc Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00
tst_qdatastream.cpp Improve support for QImages in QDataStream read transactions 2018-10-15 07:18:57 +00:00