diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 02dcb2ce06..aa009916df 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -4018,6 +4018,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 @@ -4065,6 +4066,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);