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