From 186224612c13a84e9a2b86ba83277c2f0bf2f668 Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Wed, 5 Dec 2012 18:27:42 +0000 Subject: [PATCH] Fixes tests by checking CConfigDB is initialized before using CFG_GET_USER_VAL This was SVN commit r12946. --- source/graphics/tests/test_LOSTexture.h | 6 ------ source/simulation2/Simulation2.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/source/graphics/tests/test_LOSTexture.h b/source/graphics/tests/test_LOSTexture.h index 0c3ac84704..5e6d91452f 100644 --- a/source/graphics/tests/test_LOSTexture.h +++ b/source/graphics/tests/test_LOSTexture.h @@ -19,8 +19,6 @@ #include "graphics/LOSTexture.h" #include "lib/timer.h" -#include "ps/ConfigDB.h" -#include "scripting/ScriptingHost.h" #include "simulation2/Simulation2.h" class TestLOSTexture : public CxxTest::TestSuite @@ -28,10 +26,6 @@ class TestLOSTexture : public CxxTest::TestSuite public: void test_basic() { - // Needed for CFG_GET_USER_VAL - new ScriptingHost; - new CConfigDB; - CSimulation2 sim(NULL, NULL); CLOSTexture tex(sim); diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index cd22a268af..34ec4fd037 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -69,8 +69,12 @@ public: RegisterFileReloadFunc(ReloadChangedFileCB, this); - CFG_GET_USER_VAL("ooslog", Bool, m_EnableOOSLog); - CFG_GET_USER_VAL("serializationtest", Bool, m_EnableSerializationTest); + // Tests won't have config initialised + if (CConfigDB::IsInitialised()) + { + CFG_GET_USER_VAL("ooslog", Bool, m_EnableOOSLog); + CFG_GET_USER_VAL("serializationtest", Bool, m_EnableSerializationTest); + } } ~CSimulation2Impl()