From ef22527bf5b9c067171be1f8b26165e381a85902 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 25 Sep 2023 14:21:49 -0700 Subject: [PATCH] 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. Pick-to: 6.6 Change-Id: Ifeb6206a9fa04424964bfffd1788412a438085b0 Reviewed-by: Volker Hilsheimer Reviewed-by: Qt CI Bot --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 2 ++ 1 file changed, 2 insertions(+) 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);