Alembic: not using global in unit test.
authorSybren A. Stüvel <sybren@stuvel.eu>
Thu, 2 Nov 2017 13:33:13 +0000 (14:33 +0100)
committerSybren A. Stüvel <sybren@stuvel.eu>
Thu, 2 Nov 2017 13:33:21 +0000 (14:33 +0100)
Thanks @sergey for pointing out this fix.

tests/gtests/alembic/abc_export_test.cc

index a2761513d06fdb6e71491e7ec5fe41264177b611..a3eb2c412dfe37dea992c090ca15a8d3ac8c6990 100644 (file)
@@ -5,8 +5,8 @@
 #include "intern/abc_exporter.h"
 
 extern "C" {
-#include "BKE_global.h"
 #include "BLI_utildefines.h"
+#include "BKE_library.h"
 #include "BLI_math.h"
 #include "DNA_scene_types.h"
 }
@@ -37,6 +37,7 @@ protected:
        ExportSettings settings;
        Scene scene;
        TestableAbcExporter *exporter;
+       Main *bmain;
 
        virtual void SetUp()
        {
@@ -47,18 +48,21 @@ protected:
                scene.r.frs_sec = 50;
                scene.r.frs_sec_base = 2;
 
+               bmain = BKE_main_new();
+
                exporter = NULL;
        }
 
        virtual void TearDown()
        {
+               BKE_main_free(bmain);
                delete exporter;
        }
 
        // Call after setting up the settings.
        void createExporter()
        {
-               exporter = new TestableAbcExporter(G.main, &scene, "somefile.abc", settings);
+               exporter = new TestableAbcExporter(bmain, &scene, "somefile.abc", settings);
        }
 };