From d57af00ddd6f53c2e718fa5a624e254d400635fe Mon Sep 17 00:00:00 2001 From: RodoMa92 Date: Sun, 26 Mar 2023 18:09:49 +0200 Subject: [PATCH] [tests] fixed filesystem failing tests for missing relative path to file --- src/xenia/base/testing/filesystem_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xenia/base/testing/filesystem_test.cc b/src/xenia/base/testing/filesystem_test.cc index 2829e6b9d..6f2177279 100644 --- a/src/xenia/base/testing/filesystem_test.cc +++ b/src/xenia/base/testing/filesystem_test.cc @@ -18,9 +18,10 @@ namespace base { namespace test { TEST_CASE("file_get_info", "Get Info") { + auto relative_root_dir = std::filesystem::path("../../../../"); auto test_file_name = std::filesystem::path("test_file"); auto test_file_dir = std::filesystem::path("src/xenia/base/testing/res"); - auto test_file_path = test_file_dir / test_file_name; + auto test_file_path = relative_root_dir / test_file_dir / test_file_name; filesystem::FileInfo info = {}; @@ -28,7 +29,7 @@ TEST_CASE("file_get_info", "Get Info") { CHECK(info.type == filesystem::FileInfo::Type::kFile); CHECK(info.name == test_file_name); - CHECK(info.path == test_file_dir); + CHECK(info.path == relative_root_dir / test_file_dir); CHECK(info.total_size == 81); CHECK(info.create_timestamp > 132111406279379842); CHECK(info.access_timestamp > 132111406279379842); @@ -36,9 +37,10 @@ TEST_CASE("file_get_info", "Get Info") { } TEST_CASE("folder_get_info", "Get Info") { + auto relative_root_dir = std::filesystem::path("../../../../"); auto test_folder_name = std::filesystem::path("res"); auto test_folder_dir = std::filesystem::path("src/xenia/base/testing"); - auto test_folder_path = test_folder_dir / test_folder_name; + auto test_folder_path = relative_root_dir / test_folder_dir / test_folder_name; filesystem::FileInfo info = {}; @@ -46,7 +48,7 @@ TEST_CASE("folder_get_info", "Get Info") { CHECK(info.type == filesystem::FileInfo::Type::kDirectory); CHECK(info.name == test_folder_name); - CHECK(info.path == test_folder_dir); + CHECK(info.path == relative_root_dir / test_folder_dir); CHECK(info.total_size == 0); CHECK(info.create_timestamp > 132111406279379842); CHECK(info.access_timestamp > 132111406279379842);