summaryrefslogtreecommitdiffstats
path: root/test/unit/ui
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-06-24 21:37:15 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2013-06-24 21:37:15 +0200
commit7c2e955e1552a9c4e412ea2c936be61fc78ba010 (patch)
treeee506dfbec54f998d10c385bde3a1c3fa04e66b2 /test/unit/ui
parente218dcfdf2c58f8841e7ebd220527d08e870a6d5 (diff)
parentb376486fd74fa02b0297ceef6d0f977b32358e5e (diff)
downloadcolobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.gz
colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.bz2
colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.zip
Colobot Gold 0.1.0-alpha
Diffstat (limited to 'test/unit/ui')
-rw-r--r--test/unit/ui/CMakeLists.txt12
-rw-r--r--test/unit/ui/edit_test.cpp7
-rw-r--r--test/unit/ui/stubs/app_stub.cpp6
-rw-r--r--test/unit/ui/stubs/robotmain_stub.cpp2
4 files changed, 18 insertions, 9 deletions
diff --git a/test/unit/ui/CMakeLists.txt b/test/unit/ui/CMakeLists.txt
index c899834..c18af87 100644
--- a/test/unit/ui/CMakeLists.txt
+++ b/test/unit/ui/CMakeLists.txt
@@ -5,15 +5,18 @@ include_directories(
${SRC_DIR}
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
+${CLIPBOARD_INCLUDE_DIR}
)
# Platform-dependent implementation of CSystemUtils
-if (${PLATFORM_WINDOWS})
+if(PLATFORM_WINDOWS)
set(SYSTEM_CPP_MODULE "system_windows.cpp")
-elseif(${PLATFORM_LINUX})
+elseif(PLATFORM_LINUX)
set(SYSTEM_CPP_MODULE "system_linux.cpp")
+ set(ADDITIONAL_LIB "-lX11")
else()
set(SYSTEM_CPP_MODULE "system_other.cpp")
+ set(ADDITIONAL_LIB "-lX11")
endif()
add_executable(edit_test
@@ -36,6 +39,9 @@ stubs/particle_stub.cpp
stubs/restext_stub.cpp
stubs/robotmain_stub.cpp
edit_test.cpp)
-target_link_libraries(edit_test gtest gmock ${SDL_LIBRARY} ${SDLTTF_LIBRARY} ${Boost_LIBRARIES})
+
+target_link_libraries(edit_test gtest gmock clipboard ${SDL_LIBRARY} ${SDLTTF_LIBRARY} ${Boost_LIBRARIES} ${ADDITIONAL_LIB})
+
+
add_test(edit_test ./edit_test)
diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp
index 428b66a..21af00f 100644
--- a/test/unit/ui/edit_test.cpp
+++ b/test/unit/ui/edit_test.cpp
@@ -1,10 +1,13 @@
#include "app/app.h"
+
#include "ui/edit.h"
+
#include "mocks/text_mock.h"
+#include <fstream>
+
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include <fstream>
class CEditTest : public testing::Test
{
@@ -17,7 +20,7 @@ public:
virtual void SetUp()
{
- m_robotMain = new CRobotMain(&m_app);
+ m_robotMain = new CRobotMain(&m_app, false);
m_engine = new Gfx::CEngine(nullptr);
diff --git a/test/unit/ui/stubs/app_stub.cpp b/test/unit/ui/stubs/app_stub.cpp
index 9b33e5e..960972f 100644
--- a/test/unit/ui/stubs/app_stub.cpp
+++ b/test/unit/ui/stubs/app_stub.cpp
@@ -21,7 +21,7 @@ CApplication::~CApplication()
{
}
-std::string CApplication::GetDataFilePath(DataDir /* dataDir */, const std::string& subpath)
+std::string CApplication::GetDataFilePath(DataDir /* dataDir */, const std::string& subpath) const
{
return subpath;
}
@@ -36,7 +36,7 @@ CEventQueue* CApplication::GetEventQueue()
return nullptr;
}
-std::string CApplication::GetDataDirPath()
+std::string CApplication::GetDataDirPath() const
{
return "";
}
@@ -46,7 +46,7 @@ Event CApplication::CreateUpdateEvent()
return Event(EVENT_NULL);
}
-char CApplication::GetLanguageChar()
+char CApplication::GetLanguageChar() const
{
return 'E';
}
diff --git a/test/unit/ui/stubs/robotmain_stub.cpp b/test/unit/ui/stubs/robotmain_stub.cpp
index 7988e9d..692f67f 100644
--- a/test/unit/ui/stubs/robotmain_stub.cpp
+++ b/test/unit/ui/stubs/robotmain_stub.cpp
@@ -3,7 +3,7 @@
template<> CRobotMain* CSingleton<CRobotMain>::m_instance = nullptr;
-CRobotMain::CRobotMain(CApplication* app)
+CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
{
}