diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-17 12:50:02 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-17 13:27:05 +0300 |
commit | e96ad822b382c131f9f55857364b330f6fff1521 (patch) | |
tree | 4beea0c694c4142aad2ab009059d77cefbb162b5 /source/blender/blenkernel/intern/asset_library_service_test.cc | |
parent | a6b83617e9de01c3a4719770f88fc0ad2933e55a (diff) |
Fix AssetCatalogTest failure on WIN32
Recent changes to path handling (most likely [0]) caused
AssetCatalogTest.create_catalog_after_loading_file to fail on WIN32.
The test relied on the resulting path to be joined with "/" as a path
separator. The resulting path used both forward and back-slashes.
While these do work for some API's on WIN32, mixing both in a file path
isn't expected behavior in most cases, so update the tests to use native
slash direction for file-paths.
[0]: 9f6a045e23cf4ab132ef78eeaf070bd53d0c509f
Diffstat (limited to 'source/blender/blenkernel/intern/asset_library_service_test.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_library_service_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/asset_library_service_test.cc b/source/blender/blenkernel/intern/asset_library_service_test.cc index de6180cb684..d105c5644de 100644 --- a/source/blender/blenkernel/intern/asset_library_service_test.cc +++ b/source/blender/blenkernel/intern/asset_library_service_test.cc @@ -39,7 +39,7 @@ class AssetLibraryServiceTest : public testing::Test { if (test_files_dir.empty()) { FAIL(); } - asset_library_root_ = test_files_dir + "/" + "asset_library"; + asset_library_root_ = test_files_dir + SEP_STR + "asset_library"; temp_library_path_ = ""; } @@ -59,7 +59,7 @@ class AssetLibraryServiceTest : public testing::Test { { BKE_tempdir_init(""); const CatalogFilePath tempdir = BKE_tempdir_session(); - temp_library_path_ = tempdir + "test-temporary-path/"; + temp_library_path_ = tempdir + "test-temporary-path" + SEP_STR; return temp_library_path_; } @@ -168,7 +168,8 @@ TEST_F(AssetLibraryServiceTest, has_any_unsaved_catalogs) TEST_F(AssetLibraryServiceTest, has_any_unsaved_catalogs_after_write) { const CatalogFilePath writable_dir = create_temp_path(); /* Has trailing slash. */ - const CatalogFilePath original_cdf_file = asset_library_root_ + "/blender_assets.cats.txt"; + const CatalogFilePath original_cdf_file = asset_library_root_ + SEP_STR + + "blender_assets.cats.txt"; CatalogFilePath writable_cdf_file = writable_dir + AssetCatalogService::DEFAULT_CATALOG_FILENAME; BLI_path_slash_native(writable_cdf_file.data()); ASSERT_EQ(0, BLI_copy(original_cdf_file.c_str(), writable_cdf_file.c_str())); |