aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-02-07 03:27:49 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-03-20 14:56:32 -0700
commit2ceefea5f346985bcc3a61c1562e0d836f1a0a83 (patch)
tree8956cf41bc018b449de8029331f9205f10a12ffa /tests
parent485f156e57b0fb30e51d1014de745bc6f90b7e3e (diff)
downloadPrismLauncher-2ceefea5f346985bcc3a61c1562e0d836f1a0a83.tar.gz
PrismLauncher-2ceefea5f346985bcc3a61c1562e0d836f1a0a83.tar.bz2
PrismLauncher-2ceefea5f346985bcc3a61c1562e0d836f1a0a83.zip
qt5 compatability
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/FileSystem_test.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp
index 84671889..395ca5c0 100644
--- a/tests/FileSystem_test.cpp
+++ b/tests/FileSystem_test.cpp
@@ -3,6 +3,26 @@
#include <QStandardPaths>
#include <FileSystem.h>
+#include <StringUtils.h>
+
+// Snippet from https://github.com/gulrak/filesystem#using-it-as-single-file-header
+
+#ifdef __APPLE__
+#include <Availability.h> // for deployment target to support pre-catalina targets without std::fs
+#endif // __APPLE__
+
+#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include)
+#if __has_include(<filesystem>) && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
+#define GHC_USE_STD_FS
+#include <filesystem>
+namespace fs = std::filesystem;
+#endif // MacOS min version check
+#endif // Other OSes version check
+
+#ifndef GHC_USE_STD_FS
+#include <ghc/filesystem.hpp>
+namespace fs = ghc::filesystem;
+#endif
#include <pathmatcher/RegexpMatcher.h>
@@ -328,7 +348,10 @@ slots:
QFileInfo entry_orig_info(QDir(folder).filePath(entry));
if (!entry_lnk_info.isDir()) {
qDebug() << "hard link equivalency?" << entry_lnk_info.absoluteFilePath() << "vs" << entry_orig_info.absoluteFilePath();
- QVERIFY(std::filesystem::equivalent(entry_lnk_info.filesystemAbsoluteFilePath(), entry_orig_info.filesystemAbsoluteFilePath()));
+ QVERIFY(fs::equivalent(
+ fs::path(StringUtils::toStdString(entry_lnk_info.absoluteFilePath())),
+ fs::path(StringUtils::toStdString(entry_orig_info.absoluteFilePath()))
+ ));
}
}