diff --git a/apps/openmw_test_suite/CMakeLists.txt b/apps/openmw_test_suite/CMakeLists.txt index 106837a67d..471ae14814 100644 --- a/apps/openmw_test_suite/CMakeLists.txt +++ b/apps/openmw_test_suite/CMakeLists.txt @@ -109,8 +109,8 @@ file(DOWNLOAD ) target_compile_definitions(openmw_test_suite - PRIVATE OPENMW_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data" - OPENMW_TEST_SUITE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") + PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data" + OPENMW_TEST_SUITE_SOURCE_DIR=u8"${CMAKE_CURRENT_SOURCE_DIR}") if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC) target_precompile_headers(openmw_test_suite PRIVATE diff --git a/apps/openmw_test_suite/esm3/readerscache.cpp b/apps/openmw_test_suite/esm3/readerscache.cpp index 826b803b8f..019a18b0b3 100644 --- a/apps/openmw_test_suite/esm3/readerscache.cpp +++ b/apps/openmw_test_suite/esm3/readerscache.cpp @@ -39,7 +39,7 @@ namespace { static constexpr std::size_t sInitialOffset = 324; static constexpr std::size_t sSkip = 100; - const Files::PathContainer mDataDirs {{std::string(OPENMW_DATA_DIR)}}; + const Files::PathContainer mDataDirs {{std::filesystem::path{OPENMW_DATA_DIR}}}; const Files::Collections mFileCollections {mDataDirs, true}; const std::string mContentFile = "template.omwgame"; const std::filesystem::path mContentFilePath = mFileCollections.getCollection(".omwgame").getPath(mContentFile); diff --git a/apps/openmw_test_suite/esmloader/load.cpp b/apps/openmw_test_suite/esmloader/load.cpp index ea090466a3..b1f3052ac2 100644 --- a/apps/openmw_test_suite/esmloader/load.cpp +++ b/apps/openmw_test_suite/esmloader/load.cpp @@ -25,7 +25,7 @@ namespace struct EsmLoaderTest : Test { - const Files::PathContainer mDataDirs {{std::string(OPENMW_DATA_DIR)}}; + const Files::PathContainer mDataDirs {{std::filesystem::path{OPENMW_DATA_DIR}}}; const Files::Collections mFileCollections {mDataDirs, true}; const std::vector mContentFiles {{"template.omwgame"}}; }; diff --git a/apps/openmw_test_suite/toutf8/toutf8.cpp b/apps/openmw_test_suite/toutf8/toutf8.cpp index d1cf6b2851..d34a88e087 100644 --- a/apps/openmw_test_suite/toutf8/toutf8.cpp +++ b/apps/openmw_test_suite/toutf8/toutf8.cpp @@ -1,8 +1,10 @@ #include +#include #include #include +#include #ifndef OPENMW_TEST_SUITE_SOURCE_DIR #define OPENMW_TEST_SUITE_SOURCE_DIR "" @@ -24,7 +26,7 @@ namespace { std::ifstream file; file.exceptions(std::ios::failbit | std::ios::badbit); - file.open(std::string(OPENMW_TEST_SUITE_SOURCE_DIR) + "/toutf8/data/" + fileName); + file.open(std::filesystem::path{ OPENMW_TEST_SUITE_SOURCE_DIR } / "toutf8" / "data" / Misc::StringUtils::stringToU8String(fileName)); std::stringstream buffer; buffer << file.rdbuf(); return buffer.str();