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>2020-10-05 15:24:07 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-10-05 15:25:46 +0300
commitdfbf8682980ba51451ccc7d1ee4cc02497dfeec3 (patch)
tree498f70f396c49fc94c11e514cb7631319dedb2a6
parent1d985159ad29c07ade95bbaa6876d7b39e97dc65 (diff)
Initialize CLOG to fix crashing unit tests
Initialize CLOG in the blendfile-loading unit test superclass. Since rB8683d4e88f2e CLOG is used by more areas in Blender, and without initialisation it crashes.
-rw-r--r--source/blender/blenloader/CMakeLists.txt1
-rw-r--r--source/blender/blenloader/tests/blendfile_loading_base_test.cc6
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt
index 1c5cd548bb8..c44bd8d0039 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -34,6 +34,7 @@ set(INC
../sequencer
../windowmanager
../../../intern/guardedalloc
+ ../../../intern/clog
# for writefile.c: dna_type_offsets.h
${CMAKE_BINARY_DIR}/source/blender/makesdna/intern
diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
index c743e6bcd3f..e34be68abbf 100644
--- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc
+++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
@@ -48,6 +48,8 @@
#include "WM_api.h"
#include "wm.h"
+#include "CLG_log.h"
+
BlendfileLoadingBaseTest::~BlendfileLoadingBaseTest()
{
}
@@ -58,12 +60,14 @@ void BlendfileLoadingBaseTest::SetUpTestCase()
/* Minimal code to make loading a blendfile and constructing a depsgraph not crash, copied from
* main() in creator.c. */
+ CLG_init();
BLI_threadapi_init();
DNA_sdna_current_init();
BKE_blender_globals_init();
BKE_idtype_init();
+ BKE_appdir_init();
IMB_init();
BKE_images_init();
BKE_modifier_init();
@@ -100,6 +104,8 @@ void BlendfileLoadingBaseTest::TearDownTestCase()
BKE_tempdir_session_purge();
+ CLG_exit();
+
testing::Test::TearDownTestCase();
}