[Bf-blender-cvs] [865fe33544a] temp-asset-browser-catalogs: Fix compile error of asset library test on Windows

Julian Eisel noreply at git.blender.org
Mon Sep 6 17:57:17 CEST 2021


Commit: 865fe33544a0c430d719dd844e392dd9cd30e308
Author: Julian Eisel
Date:   Mon Sep 6 17:54:42 2021 +0200
Branches: temp-asset-browser-catalogs
https://developer.blender.org/rB865fe33544a0c430d719dd844e392dd9cd30e308

Fix compile error of asset library test on Windows

The `filesystem::path::c_str()` function returns the path in the native
string format, which is `wchar` on Windows. Instead use the one that
does a conversion to `std::string` if needed.

===================================================================

M	source/blender/blenkernel/intern/asset_library_test.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/asset_library_test.cc b/source/blender/blenkernel/intern/asset_library_test.cc
index 732012301f0..a4c53cb0f0b 100644
--- a/source/blender/blenkernel/intern/asset_library_test.cc
+++ b/source/blender/blenkernel/intern/asset_library_test.cc
@@ -38,7 +38,7 @@ TEST(AssetLibraryTest, load_and_free_c_functions)
 
   /* Load the asset library. */
   const fs::path library_path = test_files_dir / "asset_library";
-  ::AssetLibrary *library_c_ptr = BKE_asset_library_load(library_path.c_str());
+  ::AssetLibrary *library_c_ptr = BKE_asset_library_load(library_path.string().c_str());
   ASSERT_NE(nullptr, library_c_ptr);
 
   /* Check that it can be cast to the C++ type and has a Catalog Service. */
@@ -66,7 +66,7 @@ TEST(AssetLibraryTest, load_nonexistent_directory)
 
   /* Load the asset library. */
   const fs::path library_path = test_files_dir / "asset_library/this/subdir/does/not/exist";
-  ::AssetLibrary *library_c_ptr = BKE_asset_library_load(library_path.c_str());
+  ::AssetLibrary *library_c_ptr = BKE_asset_library_load(library_path.string().c_str());
   ASSERT_NE(nullptr, library_c_ptr);
 
   /* Check that it can be cast to the C++ type and has a Catalog Service. */



More information about the Bf-blender-cvs mailing list