summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/envs/opengl/light_test.cpp4
-rw-r--r--test/envs/opengl/transform_test.cpp4
-rw-r--r--test/unit/graphics/core/device_mock.h2
-rw-r--r--test/unit/ui/edit_test.cpp20
-rw-r--r--test/unit/ui/stubs/app_stub.cpp10
5 files changed, 19 insertions, 21 deletions
diff --git a/test/envs/opengl/light_test.cpp b/test/envs/opengl/light_test.cpp
index 227ca2a..5c5af7c 100644
--- a/test/envs/opengl/light_test.cpp
+++ b/test/envs/opengl/light_test.cpp
@@ -78,7 +78,7 @@ void Render(Gfx::CGLDevice *device)
worldMat.LoadIdentity();
device->SetTransform(Gfx::TRANSFORM_WORLD, worldMat);
- Gfx::VertexCol line[2] = { Gfx::VertexCol() };
+ Gfx::VertexCol line[2] = {};
for (int x = -40; x <= 40; ++x)
{
@@ -103,7 +103,7 @@ void Render(Gfx::CGLDevice *device)
}
- Gfx::VertexCol quad[6] = { Gfx::VertexCol() };
+ Gfx::VertexCol quad[6] = {};
quad[0].coord = Math::Vector(-1.0f, -1.0f, 0.0f);
quad[1].coord = Math::Vector( 1.0f, -1.0f, 0.0f);
diff --git a/test/envs/opengl/transform_test.cpp b/test/envs/opengl/transform_test.cpp
index 58d8e9e..99ec9f0 100644
--- a/test/envs/opengl/transform_test.cpp
+++ b/test/envs/opengl/transform_test.cpp
@@ -73,7 +73,7 @@ void Render(Gfx::CGLDevice *device)
worldMat.LoadIdentity();
device->SetTransform(Gfx::TRANSFORM_WORLD, worldMat);
- Gfx::VertexCol line[2] = { Gfx::VertexCol() };
+ Gfx::VertexCol line[2] = {};
for (int x = -40; x <= 40; ++x)
{
@@ -98,7 +98,7 @@ void Render(Gfx::CGLDevice *device)
}
- Gfx::VertexCol quad[6] = { Gfx::VertexCol() };
+ Gfx::VertexCol quad[6] = {};
for (int i = 0; i < 6; ++i)
quad[i].color = Gfx::Color(1.0f, 1.0f, 0.0f);
diff --git a/test/unit/graphics/core/device_mock.h b/test/unit/graphics/core/device_mock.h
index 9e75daf..498239f 100644
--- a/test/unit/graphics/core/device_mock.h
+++ b/test/unit/graphics/core/device_mock.h
@@ -105,4 +105,6 @@ public:
MOCK_METHOD1(SetFillMode, void(Gfx::FillMode mode));
MOCK_METHOD0(GetFillMode, Gfx::FillMode());
+
+ MOCK_CONST_METHOD0(GetFrameBufferPixels, void*());
};
diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp
index 4a4063e..34af013 100644
--- a/test/unit/ui/edit_test.cpp
+++ b/test/unit/ui/edit_test.cpp
@@ -1,4 +1,5 @@
#include "app/app.h"
+#include "app/gamedata.h"
#include "ui/edit.h"
@@ -14,6 +15,7 @@ class CEditTest : public testing::Test
public:
CEditTest()
: m_robotMain(nullptr)
+ , m_gameData(nullptr)
, m_engine(nullptr)
, m_edit(nullptr)
{}
@@ -21,21 +23,24 @@ public:
virtual void SetUp()
{
m_robotMain = new CRobotMain(&m_app, false);
-
+
+ m_gameData = new CGameData();
+
m_engine = new Gfx::CEngine(nullptr);
-
+
m_edit = new Ui::CEdit;
}
virtual void TearDown()
{
- delete m_robotMain;
- m_robotMain = nullptr;
- delete m_engine;
- m_engine = nullptr;
delete m_edit;
m_edit = nullptr;
-
+ delete m_engine;
+ m_engine = nullptr;
+ delete m_gameData;
+ m_gameData = nullptr;
+ delete m_robotMain;
+ m_robotMain = nullptr;
}
virtual ~CEditTest()
{
@@ -45,6 +50,7 @@ public:
protected:
CApplication m_app;
CRobotMain* m_robotMain;
+ CGameData * m_gameData;
Gfx::CEngine * m_engine;
Ui::CEdit * m_edit;
CLogger m_logger;
diff --git a/test/unit/ui/stubs/app_stub.cpp b/test/unit/ui/stubs/app_stub.cpp
index 960972f..95430d8 100644
--- a/test/unit/ui/stubs/app_stub.cpp
+++ b/test/unit/ui/stubs/app_stub.cpp
@@ -21,11 +21,6 @@ CApplication::~CApplication()
{
}
-std::string CApplication::GetDataFilePath(DataDir /* dataDir */, const std::string& subpath) const
-{
- return subpath;
-}
-
CSoundInterface* CApplication::GetSound()
{
return nullptr;
@@ -36,11 +31,6 @@ CEventQueue* CApplication::GetEventQueue()
return nullptr;
}
-std::string CApplication::GetDataDirPath() const
-{
- return "";
-}
-
Event CApplication::CreateUpdateEvent()
{
return Event(EVENT_NULL);