tst_QFile::moveToTrash: avoid QSKIP+FAIL condition

QtTest can't handle a test that does both. This ends up recorded as a
skip in the summary.

Change-Id: Ifeb6206a9fa04424964bfffd1788412a438085b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ef22527bf5b9c067171be1f8b26165e381a85902)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2023-09-25 14:21:49 -07:00 committed by Qt Cherry-pick Bot
parent 5306eac755
commit e1ad387733

View File

@ -3920,6 +3920,7 @@ void tst_QFile::moveToTrash()
};
ensureFile(source, create);
if (!QFileInfo::exists(source) && create) return;
/* This test makes assumptions about the file system layout
which might be wrong - moveToTrash may fail if the file lives
@ -3967,6 +3968,7 @@ void tst_QFile::moveToTrash()
// static version
{
ensureFile(source, create);
if (!QFileInfo::exists(source) && create) return;
QString pathInTrash;
const bool success = QFile::moveToTrash(source, &pathInTrash);
QCOMPARE(success, result);