From d3edc8a62d2b3e9161457a82ab88881cf21781b8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 12 Oct 2023 15:03:21 -0700 Subject: [PATCH] tst_QStorageInfo::{tempFile,caching}: change APFS from XFAIL to SKIP Amends commit 78d0b6e9756c732bf0a7b02d258313a1d2ab461e ("Ignore failing test for free space on APFS") and merges it with the btrfs code, which seems to have the same problem. But unlike Linux systems with btrfs, Apple systems don't usually have another filesystem available so we don't bother to try and find another. Change-Id: I8f3ce163ccc5408cac39fffd178d7b4c13f0dfd1 Reviewed-by: Volker Hilsheimer Reviewed-by: Ahmad Samir --- .../corelib/io/qstorageinfo/tst_qstorageinfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index 6b37bde498..59143738dd 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -191,6 +191,13 @@ static bool checkFilesystemGoodForWriting(QTemporaryFile &file, QStorageInfo &st __FILE__, __LINE__); return false; } +#elif defined(Q_OS_DARWIN) + Q_UNUSED(file); + if (storage.fileSystemType() == "apfs") { + QTest::qSkip("APFS does not synchronously update free space; this test would fail", + __FILE__, __LINE__); + return false; + } #else Q_UNUSED(file); Q_UNUSED(storage); @@ -215,10 +222,6 @@ void tst_QStorageInfo::tempFile() file.close(); QStorageInfo storage2(file.fileName()); - if (free == storage2.bytesFree() && storage2.fileSystemType() == "apfs") { - QEXPECT_FAIL("", "This test is likely to fail on APFS", Continue); - } - QCOMPARE_NE(free, storage2.bytesFree()); } @@ -243,9 +246,6 @@ void tst_QStorageInfo::caching() QCOMPARE(free, storage2.bytesFree()); storage2.refresh(); QCOMPARE(storage1, storage2); - if (free == storage2.bytesFree() && storage2.fileSystemType() == "apfs") { - QEXPECT_FAIL("", "This test is likely to fail on APFS", Continue); - } QCOMPARE_NE(free, storage2.bytesFree()); }