summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/CMakeLists.txt167
-rw-r--r--test/unit/graphics/core/device_mock.h107
-rw-r--r--test/unit/graphics/engine/engine_mock.h14
-rw-r--r--test/unit/graphics/engine/lightman_test.cpp145
-rw-r--r--test/unit/ui/stubs/engine_stub.cpp17
5 files changed, 443 insertions, 7 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index f6a1d75..21d1986 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -1,21 +1,174 @@
set(SRC_DIR ${colobot_SOURCE_DIR}/src)
-include_directories(
-${SRC_DIR}
-${GTEST_INCLUDE_DIR}
-math
-common
+# Additional libraries per platform
+if (${MXE}) # MXE requires special treatment
+ set(PLATFORM_LIBS ${MXE_LIBS})
+elseif (${PLATFORM_WINDOWS})
+ # because it isn't included in standard linking libraries
+ set(PLATFORM_LIBS "-lintl")
+elseif(${PLATFORM_LINUX})
+ # for clock_gettime
+ set(PLATFORM_LIBS "-lrt")
+endif()
+
+
+# Configure file
+configure_file(${SRC_DIR}/common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)
+
+# Code sources
+set(COLOBOT_SOURCES
+${SRC_DIR}/app/app.cpp
+${SRC_DIR}/app/system.cpp
+${SRC_DIR}/common/event.cpp
+${SRC_DIR}/common/image.cpp
+${SRC_DIR}/common/iman.cpp
+${SRC_DIR}/common/logger.cpp
+${SRC_DIR}/common/misc.cpp
+${SRC_DIR}/common/profile.cpp
+${SRC_DIR}/common/restext.cpp
+${SRC_DIR}/common/stringutils.cpp
+${SRC_DIR}/graphics/core/color.cpp
+${SRC_DIR}/graphics/engine/camera.cpp
+${SRC_DIR}/graphics/engine/cloud.cpp
+${SRC_DIR}/graphics/engine/engine.cpp
+${SRC_DIR}/graphics/engine/lightman.cpp
+${SRC_DIR}/graphics/engine/lightning.cpp
+${SRC_DIR}/graphics/engine/modelfile.cpp
+${SRC_DIR}/graphics/engine/modelmanager.cpp
+${SRC_DIR}/graphics/engine/particle.cpp
+${SRC_DIR}/graphics/engine/planet.cpp
+${SRC_DIR}/graphics/engine/pyro.cpp
+${SRC_DIR}/graphics/engine/terrain.cpp
+${SRC_DIR}/graphics/engine/text.cpp
+${SRC_DIR}/graphics/engine/water.cpp
+${SRC_DIR}/graphics/opengl/gldevice.cpp
+${SRC_DIR}/object/auto/auto.cpp
+${SRC_DIR}/object/auto/autobase.cpp
+${SRC_DIR}/object/auto/autoconvert.cpp
+${SRC_DIR}/object/auto/autoderrick.cpp
+${SRC_DIR}/object/auto/autodestroyer.cpp
+${SRC_DIR}/object/auto/autoegg.cpp
+${SRC_DIR}/object/auto/autoenergy.cpp
+${SRC_DIR}/object/auto/autofactory.cpp
+${SRC_DIR}/object/auto/autoflag.cpp
+${SRC_DIR}/object/auto/autohuston.cpp
+${SRC_DIR}/object/auto/autoinfo.cpp
+${SRC_DIR}/object/auto/autojostle.cpp
+${SRC_DIR}/object/auto/autokid.cpp
+${SRC_DIR}/object/auto/autolabo.cpp
+${SRC_DIR}/object/auto/automush.cpp
+${SRC_DIR}/object/auto/autonest.cpp
+${SRC_DIR}/object/auto/autonuclear.cpp
+${SRC_DIR}/object/auto/autopara.cpp
+${SRC_DIR}/object/auto/autoportico.cpp
+${SRC_DIR}/object/auto/autoradar.cpp
+${SRC_DIR}/object/auto/autorepair.cpp
+${SRC_DIR}/object/auto/autoresearch.cpp
+${SRC_DIR}/object/auto/autoroot.cpp
+${SRC_DIR}/object/auto/autosafe.cpp
+${SRC_DIR}/object/auto/autostation.cpp
+${SRC_DIR}/object/auto/autotower.cpp
+${SRC_DIR}/object/brain.cpp
+${SRC_DIR}/object/mainmovie.cpp
+${SRC_DIR}/object/motion/motion.cpp
+${SRC_DIR}/object/motion/motionant.cpp
+${SRC_DIR}/object/motion/motionbee.cpp
+${SRC_DIR}/object/motion/motionhuman.cpp
+${SRC_DIR}/object/motion/motionmother.cpp
+${SRC_DIR}/object/motion/motionspider.cpp
+${SRC_DIR}/object/motion/motiontoto.cpp
+${SRC_DIR}/object/motion/motionvehicle.cpp
+${SRC_DIR}/object/motion/motionworm.cpp
+${SRC_DIR}/object/object.cpp
+${SRC_DIR}/object/robotmain.cpp
+${SRC_DIR}/object/task/task.cpp
+${SRC_DIR}/object/task/taskadvance.cpp
+${SRC_DIR}/object/task/taskbuild.cpp
+${SRC_DIR}/object/task/taskfire.cpp
+${SRC_DIR}/object/task/taskfireant.cpp
+${SRC_DIR}/object/task/taskflag.cpp
+${SRC_DIR}/object/task/taskgoto.cpp
+${SRC_DIR}/object/task/taskgungoal.cpp
+${SRC_DIR}/object/task/taskinfo.cpp
+${SRC_DIR}/object/task/taskmanager.cpp
+${SRC_DIR}/object/task/taskmanip.cpp
+${SRC_DIR}/object/task/taskpen.cpp
+${SRC_DIR}/object/task/taskrecover.cpp
+${SRC_DIR}/object/task/taskreset.cpp
+${SRC_DIR}/object/task/tasksearch.cpp
+${SRC_DIR}/object/task/taskshield.cpp
+${SRC_DIR}/object/task/taskspiderexplo.cpp
+${SRC_DIR}/object/task/tasktake.cpp
+${SRC_DIR}/object/task/taskterraform.cpp
+${SRC_DIR}/object/task/taskturn.cpp
+${SRC_DIR}/object/task/taskwait.cpp
+${SRC_DIR}/physics/physics.cpp
+${SRC_DIR}/script/cbottoken.cpp
+${SRC_DIR}/script/cmdtoken.cpp
+${SRC_DIR}/script/script.cpp
+${SRC_DIR}/ui/button.cpp
+${SRC_DIR}/ui/check.cpp
+${SRC_DIR}/ui/color.cpp
+${SRC_DIR}/ui/compass.cpp
+${SRC_DIR}/ui/control.cpp
+${SRC_DIR}/ui/displayinfo.cpp
+${SRC_DIR}/ui/displaytext.cpp
+${SRC_DIR}/ui/edit.cpp
+${SRC_DIR}/ui/editvalue.cpp
+${SRC_DIR}/ui/gauge.cpp
+${SRC_DIR}/ui/group.cpp
+${SRC_DIR}/ui/image.cpp
+${SRC_DIR}/ui/interface.cpp
+${SRC_DIR}/ui/key.cpp
+${SRC_DIR}/ui/label.cpp
+${SRC_DIR}/ui/list.cpp
+${SRC_DIR}/ui/maindialog.cpp
+${SRC_DIR}/ui/mainmap.cpp
+${SRC_DIR}/ui/mainshort.cpp
+${SRC_DIR}/ui/map.cpp
+${SRC_DIR}/ui/scroll.cpp
+${SRC_DIR}/ui/shortcut.cpp
+${SRC_DIR}/ui/slider.cpp
+${SRC_DIR}/ui/studio.cpp
+${SRC_DIR}/ui/target.cpp
+${SRC_DIR}/ui/window.cpp
)
set(UT_SOURCES
main.cpp
+graphics/engine/lightman_test.cpp
math/geometry_test.cpp
math/matrix_test.cpp
math/vector_test.cpp
)
-add_executable(colobot_ut ${UT_SOURCES})
-target_link_libraries(colobot_ut gtest)
+include_directories(
+${CMAKE_CURRENT_BINARY_DIR}
+${SRC_DIR}
+${GTEST_INCLUDE_DIR}
+${GMOCK_INCLUDE_DIR}
+.
+common
+math
+)
+
+set(LIBS
+gtest
+gmock
+CBot
+${SDL_LIBRARY}
+${SDLIMAGE_LIBRARY}
+${SDLTTF_LIBRARY}
+${OPENGL_LIBRARY}
+${PNG_LIBRARIES}
+${GLEW_LIBRARY}
+${Boost_LIBRARIES}
+${OPTIONAL_LIBS}
+${PLATFORM_LIBS}
+)
+
+add_executable(colobot_ut ${COLOBOT_SOURCES} ${UT_SOURCES})
+target_link_libraries(colobot_ut ${LIBS})
add_test(colobot_ut ./colobot_ut)
diff --git a/test/unit/graphics/core/device_mock.h b/test/unit/graphics/core/device_mock.h
new file mode 100644
index 0000000..80e214f
--- /dev/null
+++ b/test/unit/graphics/core/device_mock.h
@@ -0,0 +1,107 @@
+#pragma once
+
+#include "graphics/core/device.h"
+
+#include <gmock/gmock.h>
+
+class CDeviceMock : public Gfx::CDevice
+{
+public:
+ CDeviceMock() {}
+
+ MOCK_METHOD0(DebugHook, void());
+
+ MOCK_METHOD0(Create, bool());
+ MOCK_METHOD0(Destroy, void());
+
+ MOCK_METHOD0(BeginScene, void());
+ MOCK_METHOD0(EndScene, void());
+
+ MOCK_METHOD0(Clear, void());
+
+ MOCK_METHOD2(SetTransform, void(Gfx::TransformType type, const Math::Matrix &matrix));
+ MOCK_METHOD1(GetTransform, const Math::Matrix& (Gfx::TransformType type));
+ MOCK_METHOD2(MultiplyTransform, void(Gfx::TransformType type, const Math::Matrix &matrix));
+
+ MOCK_METHOD1(SetMaterial, void(const Gfx::Material &material));
+ MOCK_METHOD0(GetMaterial, const Gfx::Material&());
+
+ MOCK_METHOD0(GetMaxLightCount, int());
+
+ MOCK_METHOD2(SetLight, void(int index, const Gfx::Light &light));
+ MOCK_METHOD1(GetLight, const Gfx::Light&(int index));
+
+ MOCK_METHOD2(SetLightEnabled, void(int index, bool enabled));
+ MOCK_METHOD1(GetLightEnabled, bool(int index));
+
+ MOCK_METHOD2(CreateTexture, Gfx::Texture(CImage *image, const Gfx::TextureCreateParams &params));
+ MOCK_METHOD2(CreateTexture, Gfx::Texture(ImageData *data, const Gfx::TextureCreateParams &params));
+
+ MOCK_METHOD1(DestroyTexture, void(const Gfx::Texture &texture));
+ MOCK_METHOD0(DestroyAllTextures, void());
+
+ MOCK_METHOD0(GetMaxTextureStageCount, int());
+
+ MOCK_METHOD2(SetTexture, void(int index, const Gfx::Texture &texture));
+ MOCK_METHOD2(SetTexture, void(int index, unsigned int textureId));
+ MOCK_METHOD1(GetTexture, Gfx::Texture(int index));
+
+ MOCK_METHOD2(SetTextureEnabled, void(int index, bool enabled));
+ MOCK_METHOD1(GetTextureEnabled, bool(int index));
+
+ MOCK_METHOD2(SetTextureStageParams, void(int index, const Gfx::TextureStageParams &params));
+ MOCK_METHOD1(GetTextureStageParams, Gfx::TextureStageParams(int index));
+
+ MOCK_METHOD3(SetTextureStageWrap, void(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT));
+
+ MOCK_METHOD4(DrawPrimitive, void(Gfx::PrimitiveType type, const Gfx::Vertex *vertices, int vertexCount, Gfx::Color color));
+ MOCK_METHOD4(DrawPrimitive, void(Gfx::PrimitiveType type, const Gfx::VertexTex2 *vertices, int vertexCount, Gfx::Color color));
+ MOCK_METHOD3(DrawPrimitive, void(Gfx::PrimitiveType type, const Gfx::VertexCol *vertices, int vertexCount));
+
+ MOCK_METHOD3(CreateStaticBuffer, unsigned int(Gfx::PrimitiveType primitiveType, const Gfx::Vertex* vertices, int vertexCount));
+ MOCK_METHOD3(CreateStaticBuffer, unsigned int(Gfx::PrimitiveType primitiveType, const Gfx::VertexTex2* vertices, int vertexCount));
+ MOCK_METHOD3(CreateStaticBuffer, unsigned int(Gfx::PrimitiveType primitiveType, const Gfx::VertexCol* vertices, int vertexCount));
+
+ MOCK_METHOD4(UpdateStaticBuffer, void(unsigned int bufferId, Gfx::PrimitiveType primitiveType, const Gfx::Vertex* vertices, int vertexCount));
+ MOCK_METHOD4(UpdateStaticBuffer, void(unsigned int bufferId, Gfx::PrimitiveType primitiveType, const Gfx::VertexTex2* vertices, int vertexCount));
+ MOCK_METHOD4(UpdateStaticBuffer, void(unsigned int bufferId, Gfx::PrimitiveType primitiveType, const Gfx::VertexCol* vertices, int vertexCount));
+
+ MOCK_METHOD1(DrawStaticBuffer, void(unsigned int bufferId));
+
+ MOCK_METHOD1(DestroyStaticBuffer, void(unsigned int bufferId));
+
+ MOCK_METHOD2(ComputeSphereVisibility, int(const Math::Vector &center, float radius));
+
+ MOCK_METHOD2(SetRenderState, void(Gfx::RenderState state, bool enabled));
+ MOCK_METHOD1(GetRenderState, bool(Gfx::RenderState state));
+
+ MOCK_METHOD1(SetDepthTestFunc, void(Gfx::CompFunc func));
+ MOCK_METHOD0(GetDepthTestFunc, Gfx::CompFunc());
+
+ MOCK_METHOD1(SetDepthBias, void(float factor));
+ MOCK_METHOD0(GetDepthBias, float());
+
+ MOCK_METHOD2(SetAlphaTestFunc, void(Gfx::CompFunc func, float refValue));
+ MOCK_METHOD2(GetAlphaTestFunc, void(Gfx::CompFunc &func, float &refValue));
+
+ MOCK_METHOD2(SetBlendFunc, void(Gfx::BlendFunc srcBlend, Gfx::BlendFunc dstBlend));
+ MOCK_METHOD2(GetBlendFunc, void(Gfx::BlendFunc &srcBlend, Gfx::BlendFunc &dstBlend));
+
+ MOCK_METHOD1(SetClearColor, void(const Gfx::Color &color));
+ MOCK_METHOD0(GetClearColor, Gfx::Color());
+
+ MOCK_METHOD1(SetGlobalAmbient, void(const Gfx::Color &color));
+ MOCK_METHOD0(GetGlobalAmbient, Gfx::Color());
+
+ MOCK_METHOD5(SetFogParams, void(Gfx::FogMode mode, const Gfx::Color &color, float start, float end, float density));
+ MOCK_METHOD5(GetFogParams, void(Gfx::FogMode &mode, Gfx::Color &color, float &start, float &end, float &density));
+
+ MOCK_METHOD1(SetCullMode, void(Gfx::CullMode mode));
+ MOCK_METHOD0(GetCullMode, Gfx::CullMode());
+
+ MOCK_METHOD1(SetShadeModel, void(Gfx::ShadeModel model));
+ MOCK_METHOD0(GetShadeModel, Gfx::ShadeModel());
+
+ MOCK_METHOD1(SetFillMode, void(Gfx::FillMode mode));
+ MOCK_METHOD0(GetFillMode, Gfx::FillMode());
+};
diff --git a/test/unit/graphics/engine/engine_mock.h b/test/unit/graphics/engine/engine_mock.h
new file mode 100644
index 0000000..1a15eca
--- /dev/null
+++ b/test/unit/graphics/engine/engine_mock.h
@@ -0,0 +1,14 @@
+#include "graphics/engine/engine.h"
+
+#include <gmock/gmock.h>
+
+class CEngineMock : public Gfx::CEngine
+{
+public:
+ CEngineMock() : Gfx::CEngine(nullptr) {}
+
+ MOCK_METHOD0(GetPause, bool());
+
+ MOCK_METHOD0(GetEyePt, Math::Vector());
+ MOCK_METHOD0(GetLookatPt, Math::Vector());
+};
diff --git a/test/unit/graphics/engine/lightman_test.cpp b/test/unit/graphics/engine/lightman_test.cpp
new file mode 100644
index 0000000..529cee8
--- /dev/null
+++ b/test/unit/graphics/engine/lightman_test.cpp
@@ -0,0 +1,145 @@
+#include "graphics/engine/lightman.h"
+
+#include "graphics/core/device_mock.h"
+#include "graphics/engine/engine_mock.h"
+
+#include <gtest/gtest.h>
+
+using namespace Gfx;
+
+using testing::_;
+using testing::Invoke;
+using testing::Return;
+
+class LightManagerUT : public testing::Test
+{
+protected:
+ LightManagerUT()
+ : lightManager(&engine)
+ {}
+
+ void PrepareLightTesting(int maxLights, Math::Vector eyePos);
+ void CheckLightSorting(EngineObjectType objectType, const std::vector<int>& expectedLights);
+ void CheckLight(int index, const Light& light);
+ void AddLight(int type, LightPriority priority, bool used, bool enabled,
+ Math::Vector pos, EngineObjectType includeType, EngineObjectType excludeType);
+
+
+ CLightManager lightManager;
+ CEngineMock engine;
+ CDeviceMock device;
+
+private:
+ std::vector<DynamicLight> dynamicLights;
+ std::vector<int> expectedLightTypes;
+ int maxLightsCount;
+};
+
+void LightManagerUT::PrepareLightTesting(int maxLights, Math::Vector eyePos)
+{
+ maxLightsCount = maxLights;
+
+ EXPECT_CALL(device, GetMaxLightCount()).WillOnce(Return(maxLights));
+ lightManager.SetDevice(&device);
+
+ ON_CALL(device, SetLight(_, _)).WillByDefault(Invoke(this, &LightManagerUT::CheckLight));
+
+ EXPECT_CALL(engine, GetEyePt()).WillRepeatedly(Return(eyePos));
+}
+
+void LightManagerUT::CheckLightSorting(EngineObjectType objectType, const std::vector<int>& expectedLights)
+{
+ expectedLightTypes = expectedLights;
+
+ EXPECT_CALL(device, SetLight(_, _)).Times(expectedLights.size());
+
+ for (int i = 0; i < static_cast<int>( expectedLights.size() ); ++i)
+ EXPECT_CALL(device, SetLightEnabled(i, true));
+
+ for (int i = expectedLights.size(); i < maxLightsCount; ++i)
+ EXPECT_CALL(device, SetLightEnabled(i, false));
+
+ lightManager.UpdateDeviceLights(objectType);
+}
+
+void LightManagerUT::CheckLight(int index, const Light& light)
+{
+ ASSERT_TRUE(index >= 0 && index < static_cast<int>( expectedLightTypes.size() ));
+ ASSERT_EQ(expectedLightTypes[index], light.type);
+}
+
+void LightManagerUT::AddLight(int type, LightPriority priority, bool used, bool enabled,
+ Math::Vector pos, EngineObjectType includeType, EngineObjectType excludeType)
+{
+ int rank = lightManager.CreateLight(priority);
+
+ Light light;
+ light.type = static_cast<LightType>(type);
+ lightManager.SetLight(rank, light);
+
+ lightManager.SetLightEnabled(rank, enabled);
+ lightManager.SetLightIncludeType(rank, includeType);
+ lightManager.SetLightExcludeType(rank, excludeType);
+
+ if (!used)
+ lightManager.DeleteLight(rank);
+}
+
+TEST_F(LightManagerUT, LightSorting_UnusedOrDisabledAreSkipped)
+{
+ const int lightCount = 10;
+ const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
+ PrepareLightTesting(lightCount, eyePos);
+
+ AddLight(1, LIGHT_PRI_LOW, false, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(2, LIGHT_PRI_LOW, true, false, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(3, LIGHT_PRI_LOW, false, false, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+
+ std::vector<int> expectedLights;
+ CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
+}
+
+TEST_F(LightManagerUT, LightSorting_IncludeTypesAreIncluded)
+{
+ const int lightCount = 10;
+ const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
+ PrepareLightTesting(lightCount, eyePos);
+
+ AddLight(1, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(2, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_TERRAIN, ENG_OBJTYPE_NULL);
+ AddLight(3, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_QUARTZ, ENG_OBJTYPE_NULL);
+
+ std::vector<int> expectedLights = { 1, 2 };
+ CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
+}
+
+TEST_F(LightManagerUT, LightSorting_ExcludeTypesAreExcluded)
+{
+ const int lightCount = 10;
+ const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
+ PrepareLightTesting(lightCount, eyePos);
+
+ AddLight(1, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(2, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_TERRAIN);
+ AddLight(3, LIGHT_PRI_LOW, true, true, Math::Vector(0.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_QUARTZ);
+
+ std::vector<int> expectedLights = { 1, 3 };
+ CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
+}
+
+TEST_F(LightManagerUT, LightSorting_SortingAccordingToDistance)
+{
+ const int lightCount = 3;
+ const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
+ PrepareLightTesting(lightCount, eyePos);
+
+ AddLight(1, LIGHT_PRI_HIGH, true, true, Math::Vector(10.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(2, LIGHT_PRI_LOW, true, true, Math::Vector(4.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(3, LIGHT_PRI_HIGH, true, true, Math::Vector(20.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(4, LIGHT_PRI_LOW, true, true, Math::Vector(11.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(5, LIGHT_PRI_LOW, true, true, Math::Vector(100.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+ AddLight(6, LIGHT_PRI_HIGH, true, true, Math::Vector(21.0f, 0.0f, 0.0f), ENG_OBJTYPE_NULL, ENG_OBJTYPE_NULL);
+
+ std::vector<int> expectedLights = { 1, 2, 3 };
+ CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
+}
diff --git a/test/unit/ui/stubs/engine_stub.cpp b/test/unit/ui/stubs/engine_stub.cpp
index 40886da..0a2777c 100644
--- a/test/unit/ui/stubs/engine_stub.cpp
+++ b/test/unit/ui/stubs/engine_stub.cpp
@@ -77,11 +77,28 @@ int CEngine::GetEditIndentValue()
void CEngine::DeleteTexture(const std::string& /* texName */)
{
}
+
Texture CEngine::LoadTexture(const std::string& /* name */)
{
Texture texture;
return texture;
}
+Math::Vector CEngine::GetEyePt()
+{
+ return Math::Vector();
+}
+
+Math::Vector CEngine::GetLookatPt()
+{
+ return Math::Vector();
+}
+
+bool CEngine::GetPause()
+{
+ return false;
+}
+
+
} /* Gfx */