From 96e94007615702d22e8ba3b1d96b8a9e3320b9ec Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 4 Mar 2022 14:34:37 +0100 Subject: [PATCH] sys: Fixed unit test building --- lib/libimhex/include/hex/helpers/fs_macos.h | 2 +- tests/helpers/source/file.cpp | 10 +++++----- tests/helpers/source/net.cpp | 4 ++-- tests/pattern_language/include/test_provider.hpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/libimhex/include/hex/helpers/fs_macos.h b/lib/libimhex/include/hex/helpers/fs_macos.h index 0d48e94f2..a8a16a299 100644 --- a/lib/libimhex/include/hex/helpers/fs_macos.h +++ b/lib/libimhex/include/hex/helpers/fs_macos.h @@ -1,7 +1,7 @@ #pragma once #if defined(OS_MACOS) - #include + #include namespace hex { std::string getMacExecutableDirectoryPath(); diff --git a/tests/helpers/source/file.cpp b/tests/helpers/source/file.cpp index 38f379b7d..6b96fcb11 100644 --- a/tests/helpers/source/file.cpp +++ b/tests/helpers/source/file.cpp @@ -6,25 +6,25 @@ using namespace std::literals::string_literals; TEST_SEQUENCE("FileAccess") { - const auto FilePath = hex::fs::current_path() / "file.txt"; + const auto FilePath = std::fs::current_path() / "file.txt"; const auto FileContent = "Hello World"; { - hex::File file(FilePath, hex::File::Mode::Create); + hex::fs::File file(FilePath, hex::fs::File::Mode::Create); TEST_ASSERT(file.isValid()); file.write(FileContent); } { - hex::File file(FilePath, hex::File::Mode::Read); + hex::fs::File file(FilePath, hex::fs::File::Mode::Read); TEST_ASSERT(file.isValid()); TEST_ASSERT(file.readString() == FileContent); } { - hex::File file(FilePath, hex::File::Mode::Write); + hex::fs::File file(FilePath, hex::fs::File::Mode::Write); TEST_ASSERT(file.isValid()); @@ -33,7 +33,7 @@ TEST_SEQUENCE("FileAccess") { } { - hex::File file(FilePath, hex::File::Mode::Read); + hex::fs::File file(FilePath, hex::fs::File::Mode::Read); if (file.isValid()) TEST_FAIL(); } diff --git a/tests/helpers/source/net.cpp b/tests/helpers/source/net.cpp index 5bff6c674..ec0683952 100644 --- a/tests/helpers/source/net.cpp +++ b/tests/helpers/source/net.cpp @@ -37,13 +37,13 @@ TEST_SEQUENCE("TipsAPI") { TEST_SEQUENCE("ContentAPI") { hex::Net net; - const auto FilePath = hex::fs::current_path() / "elf.hexpat"; + const auto FilePath = std::fs::current_path() / "elf.hexpat"; auto result = net.downloadFile("https://api.werwolv.net/content/imhex/patterns/elf.hexpat", FilePath).get(); TEST_ASSERT(result.code == 200); - hex::File file(FilePath, hex::File::Mode::Read); + hex::fs::File file(FilePath, hex::fs::File::Mode::Read); if (!file.isValid()) TEST_FAIL(); diff --git a/tests/pattern_language/include/test_provider.hpp b/tests/pattern_language/include/test_provider.hpp index 9d972bd7a..1827ae617 100644 --- a/tests/pattern_language/include/test_provider.hpp +++ b/tests/pattern_language/include/test_provider.hpp @@ -9,7 +9,7 @@ namespace hex::test { class TestProvider : public prv::Provider { public: - TestProvider() : Provider(), m_testFile(File("test_data", File::Mode::Read)) { + TestProvider() : Provider(), m_testFile(fs::File("test_data", fs::File::Mode::Read)) { if (!this->m_testFile.isValid() || this->m_testFile.getSize() == 0) { hex::log::fatal("Failed to open test data!"); throw std::runtime_error(""); @@ -49,7 +49,7 @@ namespace hex::test { void close() override { } private: - File m_testFile; + fs::File m_testFile; }; } \ No newline at end of file