1
0
forked from 0ad/0ad

Fixes tests by checking CConfigDB is initialized before using CFG_GET_USER_VAL

This was SVN commit r12946.
This commit is contained in:
historic_bruno 2012-12-05 18:27:42 +00:00
parent f528e58983
commit 186224612c
2 changed files with 6 additions and 8 deletions

View File

@ -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);

View File

@ -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()