Fixed tests
parent
fd8ea13cbb
commit
092e7cc68d
|
@ -101,9 +101,25 @@ std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetLogger()->Error("file subpath error\n");
|
if(m_dataDirs.size() > 0) {
|
||||||
|
std::stringstream str;
|
||||||
|
if ( subpath.find("save") == std::string::npos ){ // if its NOT a path to a savefile screenshot
|
||||||
|
str << m_dataDirs[0];
|
||||||
|
str << "/";
|
||||||
|
str << m_standardDataDirs[index];
|
||||||
|
|
||||||
|
if (dir == DIR_HELP)
|
||||||
|
{
|
||||||
|
str << "/";
|
||||||
|
str << CApplication::GetInstancePointer()->GetLanguageChar();
|
||||||
|
}
|
||||||
|
str << "/";
|
||||||
|
}
|
||||||
|
str << subpath;
|
||||||
|
return str.str();
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return subpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CGameData::GetDataPath(const std::string &subpath)
|
std::string CGameData::GetDataPath(const std::string &subpath)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
|
#include "app/gamedata.h"
|
||||||
|
|
||||||
#include "ui/edit.h"
|
#include "ui/edit.h"
|
||||||
|
|
||||||
|
@ -14,6 +15,7 @@ class CEditTest : public testing::Test
|
||||||
public:
|
public:
|
||||||
CEditTest()
|
CEditTest()
|
||||||
: m_robotMain(nullptr)
|
: m_robotMain(nullptr)
|
||||||
|
, m_gameData(nullptr)
|
||||||
, m_engine(nullptr)
|
, m_engine(nullptr)
|
||||||
, m_edit(nullptr)
|
, m_edit(nullptr)
|
||||||
{}
|
{}
|
||||||
|
@ -21,21 +23,24 @@ public:
|
||||||
virtual void SetUp()
|
virtual void SetUp()
|
||||||
{
|
{
|
||||||
m_robotMain = new CRobotMain(&m_app, false);
|
m_robotMain = new CRobotMain(&m_app, false);
|
||||||
|
|
||||||
|
m_gameData = new CGameData();
|
||||||
|
|
||||||
m_engine = new Gfx::CEngine(nullptr);
|
m_engine = new Gfx::CEngine(nullptr);
|
||||||
|
|
||||||
m_edit = new Ui::CEdit;
|
m_edit = new Ui::CEdit;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown()
|
virtual void TearDown()
|
||||||
{
|
{
|
||||||
delete m_robotMain;
|
|
||||||
m_robotMain = nullptr;
|
|
||||||
delete m_engine;
|
|
||||||
m_engine = nullptr;
|
|
||||||
delete m_edit;
|
delete m_edit;
|
||||||
m_edit = nullptr;
|
m_edit = nullptr;
|
||||||
|
delete m_engine;
|
||||||
|
m_engine = nullptr;
|
||||||
|
delete m_gameData;
|
||||||
|
m_gameData = nullptr;
|
||||||
|
delete m_robotMain;
|
||||||
|
m_robotMain = nullptr;
|
||||||
}
|
}
|
||||||
virtual ~CEditTest()
|
virtual ~CEditTest()
|
||||||
{
|
{
|
||||||
|
@ -45,6 +50,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
CApplication m_app;
|
CApplication m_app;
|
||||||
CRobotMain* m_robotMain;
|
CRobotMain* m_robotMain;
|
||||||
|
CGameData * m_gameData;
|
||||||
Gfx::CEngine * m_engine;
|
Gfx::CEngine * m_engine;
|
||||||
Ui::CEdit * m_edit;
|
Ui::CEdit * m_edit;
|
||||||
CLogger m_logger;
|
CLogger m_logger;
|
||||||
|
|
Loading…
Reference in New Issue