tst_QStorageInfo::{tempFile,caching}: change APFS from XFAIL to SKIP

Amends commit 78d0b6e975 ("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 <volker.hilsheimer@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
bb10
Thiago Macieira 2023-10-12 15:03:21 -07:00
parent ae03ffaffd
commit d3edc8a62d
1 changed files with 7 additions and 7 deletions

View File

@ -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());
}