qt6-bb10/tests/auto/corelib/io
Thiago Macieira f3fc37146d QSaveFile: make it so flush() errors imply commit() failed
QSaveFile records past write errors in writeData(), but often the
QFileDevice::writeData() calls it places will succeed because the data
is only being buffered. Instead, the failures are noticed only by
flush(), whose actions do not affect QSaveFilePrivate::writeError.

[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true and overwrite its intended target file even though it failed
to flush buffered data to the storage, which could cause data loss. This
issue can be worked around by calling flush() first and only calling
commit() if that returns success.

[ChangeLog][QtCore][QSaveFile] Fixed a bug that caused commit() to
return true even after a cancelWriting() call had been placed, if
writing directly to the target file (that is, only with
setDirectWriteFallback() set to true). Note that the state of the file
does not change under those conditions, only the value returned by the
function.

Drive-by clarify a comment from 6bf1674f1e51fd8b08783035cda7493ecd63b44
(Qt 4.6 "Don't drop errors from flush on QFile::close") which had me
chasing the wrong lead.

Fixes: QTBUG-132332
Pick-to: 6.5 5.15
Change-Id: I427df6fd02132d02be91fffd175579c35b9c06cc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 92373d353cf090faa03cbc8aca505d1784b10b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 09d44fdef3acf4146a26d6ae757eb2915b29f147)
2024-12-26 19:50:47 +00:00
..
largefile Limit size of large files test for VxWorks 2024-05-16 14:04:41 +02:00
qabstractfileengine QDirListing: add flags to handle entries filtering 2024-06-27 01:31:40 +00:00
qbuffer Change license for tests files 2024-02-04 09:56:42 +01:00
qdataurl Change license for tests files 2024-02-04 09:56:42 +01:00
qdebug tst_QDebug: extend test with pair<references> 2024-10-28 14:30:11 +00:00
qdir QDir: change qt_{cleanPath,normalizePathSegments} to returning bool 2024-09-14 16:37:12 +00:00
qdiriterator QAbstractFileEngine: remove beginEntryList(QDir::Filters) 2024-10-19 10:09:37 +00:00
qdirlisting QDirListing: make end() return a sentinel 2024-09-03 18:06:32 +00:00
qfile tests: Explicitly check for pathconf(_PC_CASE_SENSITIVE) == 1 2024-09-23 19:36:53 +00:00
qfileinfo Replace QWinRegistryKey::dwordValue with QWinRegistryKey::value<T> 2024-11-09 20:00:08 +00:00
qfileselector Handle VxWorks in QFileSelector 2024-06-19 14:02:58 +00:00
qfilesystementry Change license for tests files 2024-02-04 09:56:42 +01:00
qfilesystemmetadata Change license for tests files 2024-02-04 09:56:42 +01:00
qfilesystemwatcher Fix tst_QFileSysteMWatcher::basicTest on VxWorks 2024-05-15 18:22:39 +02:00
qiodevice Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
qipaddress Change license for tests files 2024-02-04 09:56:42 +01:00
qlockfile Change license for tests files 2024-02-04 09:56:42 +01:00
qloggingcategory Change license for tests files 2024-02-04 09:56:42 +01:00
qloggingregistry Change license for tests files 2024-02-04 09:56:42 +01:00
qnodebug Change license for tests files 2024-02-04 09:56:42 +01:00
qprocess tst_QProcess: silence -Wunused-result 2024-06-18 08:09:23 +00:00
qprocess-noapplication Change license for tests files 2024-02-04 09:56:42 +01:00
qprocessenvironment Skip tst_QProcessEnvironment::systemEnvironment on VxWorks 2024-05-28 15:22:20 +02:00
qresourceengine Add copyright and licensing to .cpp and .h files missing them 2024-05-28 09:47:01 +02:00
qsavefile QSaveFile: make it so flush() errors imply commit() failed 2024-12-26 19:50:47 +00:00
qsettings tests: Explicitly check for pathconf(_PC_CASE_SENSITIVE) == 1 2024-09-23 19:36:53 +00:00
qstandardpaths wasm: Enable qstandardpaths test 2024-05-06 16:01:28 +02:00
qstorageinfo tst_QStorageInfo: port from qvsnprintf to std::vsnprintf() 2024-07-22 21:00:12 +00:00
qtemporarydir tst_qtemporarydir: refactor a test 2024-03-21 05:49:54 +02:00
qtemporaryfile tests: Fix tst_qtemporaryfile to use temporary file 2024-05-29 15:24:25 +03:00
qurl Tests: Reduce the number of module includes 2024-11-04 19:42:27 +00:00
qurlinternal Change license for tests files 2024-02-04 09:56:42 +01:00
qurlquery QTest: rip out qxp::function_ref from compare_helper() 2024-04-26 18:19:36 +02:00
qurluts46 Add REUSE.toml files 2024-11-07 08:38:49 +01:00
qzip Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt tst_QSettings: port to QTEST_THROW_ON_FAIL 2024-06-27 06:06:02 +00:00