diff options
Diffstat (limited to 'source/blender/blenkernel/intern/asset_library_test.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_library_test.cc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/asset_library_test.cc b/source/blender/blenkernel/intern/asset_library_test.cc index 30ac4dc6ad8..c6c949a7ec4 100644 --- a/source/blender/blenkernel/intern/asset_library_test.cc +++ b/source/blender/blenkernel/intern/asset_library_test.cc @@ -21,11 +21,32 @@ #include "BKE_asset_catalog.hh" #include "BKE_asset_library.hh" +#include "asset_library_service.hh" + +#include "CLG_log.h" + #include "testing/testing.h" namespace blender::bke::tests { -TEST(AssetLibraryTest, load_and_free_c_functions) +class AssetLibraryTest : public testing::Test { + public: + static void SetUpTestSuite() + { + CLG_init(); + } + static void TearDownTestSuite() + { + CLG_exit(); + } + + void TearDown() override + { + AssetLibraryService::destroy(); + } +}; + +TEST_F(AssetLibraryTest, bke_asset_library_load) { const std::string test_files_dir = blender::tests::flags_test_asset_dir(); if (test_files_dir.empty()) { @@ -50,11 +71,9 @@ TEST(AssetLibraryTest, load_and_free_c_functions) AssetCatalog *poses_ellie = service->find_catalog(uuid_poses_ellie); ASSERT_NE(nullptr, poses_ellie) << "unable to find POSES_ELLIE catalog"; EXPECT_EQ("character/Ellie/poselib", poses_ellie->path.str()); - - BKE_asset_library_free(library_c_ptr); } -TEST(AssetLibraryTest, load_nonexistent_directory) +TEST_F(AssetLibraryTest, load_nonexistent_directory) { const std::string test_files_dir = blender::tests::flags_test_asset_dir(); if (test_files_dir.empty()) { @@ -75,8 +94,6 @@ TEST(AssetLibraryTest, load_nonexistent_directory) /* Check that the catalog service doesn't have any catalogs. */ EXPECT_TRUE(service->is_empty()); - - BKE_asset_library_free(library_c_ptr); } } // namespace blender::bke::tests |