From f13a0fc7325793cb62349b14a028e8da924bb0e0 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 28 Mar 2024 18:21:19 +0800 Subject: [PATCH] Also prevent use of std::filesystem in macOS 10.14 Signed-off-by: Claudio Cambra --- test/syncenginetestutils.cpp | 4 ++++ test/testpermissions.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/test/syncenginetestutils.cpp b/test/syncenginetestutils.cpp index 50f6fddeb..a12261ce3 100644 --- a/test/syncenginetestutils.cpp +++ b/test/syncenginetestutils.cpp @@ -17,7 +17,9 @@ #include #include +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 #include +#endif PathComponents::PathComponents(const char *path) : PathComponents { QString::fromUtf8(path) } @@ -50,9 +52,11 @@ void DiskFileModifier::remove(const QString &relativePath) if (fi.isFile()) { QVERIFY(_rootDir.remove(relativePath)); } else { +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 const auto pathToDelete = fi.filePath().toStdWString(); std::filesystem::permissions(pathToDelete, std::filesystem::perms::owner_exec, std::filesystem::perm_options::add); QVERIFY(std::filesystem::remove_all(pathToDelete)); +#endif } } diff --git a/test/testpermissions.cpp b/test/testpermissions.cpp index 401915e6d..8d6c6297b 100644 --- a/test/testpermissions.cpp +++ b/test/testpermissions.cpp @@ -11,7 +11,9 @@ #include +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 #include +#endif #include using namespace OCC; @@ -77,6 +79,7 @@ private slots: Logger::instance()->setLogDebug(true); } +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 void t7pl() { FakeFolder fakeFolder{ FileInfo() }; @@ -384,6 +387,7 @@ private slots: QCOMPARE(count, 2); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); } +#endif static void setAllPerm(FileInfo *fi, OCC::RemotePermissions perm) { @@ -592,6 +596,7 @@ private slots: QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); } +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 static void demo_perms(std::filesystem::perms p) { using std::filesystem::perms; @@ -741,6 +746,7 @@ private slots: QVERIFY(testFolderStatus.permissions() & std::filesystem::perms::owner_read); QVERIFY(!static_cast(testFolderStatus.permissions() & std::filesystem::perms::owner_write)); } +#endif }; QTEST_GUILESS_MAIN(TestPermissions)