Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-18 18:29:24 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-18 18:29:24 +0300
commit46fe43feca6924dabde37b79cd6239bfbbeabeb8 (patch)
tree21138d4ba2ea336944bfdb255698aca115bf8f19 /source/blender/blenkernel/intern/asset_library_service_test.cc
parent3cbe9218994aec59e417a595b9a1f7256108e693 (diff)
Fix failing `AssetLibraryService` test by removing test code
Remove the code I had hoped to fix in rB3edae09e, the fix was unreliable. No functional changes to Blender.
Diffstat (limited to 'source/blender/blenkernel/intern/asset_library_service_test.cc')
-rw-r--r--source/blender/blenkernel/intern/asset_library_service_test.cc33
1 files changed, 6 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/asset_library_service_test.cc b/source/blender/blenkernel/intern/asset_library_service_test.cc
index e2d7a7680b6..b4bb1dc0895 100644
--- a/source/blender/blenkernel/intern/asset_library_service_test.cc
+++ b/source/blender/blenkernel/intern/asset_library_service_test.cc
@@ -59,22 +59,13 @@ TEST_F(AssetLibraryServiceTest, get_destroy)
EXPECT_EQ(service, AssetLibraryService::get())
<< "Calling twice without destroying in between should return the same instance.";
- AssetLibraryService::destroy();
-
- /* On GCC in release mode (and maybe also debug mode without ASAN enabled), allocating an
- * #AssetLibraryService will reuse the space that should have just been freed in the above
- * destroy() call. To see that the get() call below really allocates a new object, allocate a
- * dummy block of memory first. */
- AssetLibraryService *dummy_pointer = new AssetLibraryService();
-
- EXPECT_NE(service, AssetLibraryService::get())
- << "Calling twice with destroying in between should return a new instance.";
-
/* This should not crash. */
AssetLibraryService::destroy();
AssetLibraryService::destroy();
- delete dummy_pointer;
+ /* Note: there used to be a test for the opposite here, that after a call to
+ * AssetLibraryService::destroy() the above calls should return freshly allocated objects. This
+ * cannot be reliably tested by just pointer comparison, though. */
}
TEST_F(AssetLibraryServiceTest, library_pointers)
@@ -88,21 +79,9 @@ TEST_F(AssetLibraryServiceTest, library_pointers)
EXPECT_EQ(curfile_lib, service->get_asset_library_current_file())
<< "Calling twice without destroying in between should return the same instance.";
- AssetLibraryService::destroy();
-
- /* On GCC in release mode (and maybe also debug mode without ASAN enabled), allocating an
- * #AssetLibraryService will reuse the space that should have just been freed in the above
- * destroy() call. To see that the get() call below really allocates a new object, allocate a
- * dummy block of memory first. */
- AssetLibrary *dummy_pointer = new AssetLibrary();
-
- service = AssetLibraryService::get();
- EXPECT_NE(lib, service->get_asset_library_on_disk(asset_library_root_))
- << "Calling twice with destroying in between should return a new instance.";
- EXPECT_NE(curfile_lib, service->get_asset_library_current_file())
- << "Calling twice with destroying in between should return a new instance.";
-
- delete dummy_pointer;
+ /* Note: there used to be a test for the opposite here, that after a call to
+ * AssetLibraryService::destroy() the above calls should return freshly allocated objects. This
+ * cannot be reliably tested by just pointer comparison, though. */
}
TEST_F(AssetLibraryServiceTest, catalogs_loaded)