From 907dcdcf7bb513ecfeb1c988f071f497dcfbf765 Mon Sep 17 00:00:00 2001 From: savilli <78875209+savilli@users.noreply.github.com> Date: Tue, 27 Sep 2022 22:22:11 +0200 Subject: Add unittests for item movement code (#11885) --- src/unittest/test_activeobject.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/unittest/test_activeobject.cpp') diff --git a/src/unittest/test_activeobject.cpp b/src/unittest/test_activeobject.cpp index 84c46fd77..872130a2a 100644 --- a/src/unittest/test_activeobject.cpp +++ b/src/unittest/test_activeobject.cpp @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "test.h" -#include "activeobject.h" +#include "mock_activeobject.h" class TestActiveObject : public TestBase { @@ -39,20 +39,9 @@ void TestActiveObject::runTests(IGameDef *gamedef) TEST(testAOAttributes); } -class TestAO : public ActiveObject -{ -public: - TestAO(u16 id) : ActiveObject(id) {} - - virtual ActiveObjectType getType() const { return ACTIVEOBJECT_TYPE_TEST; } - virtual bool getCollisionBox(aabb3f *toset) const { return false; } - virtual bool getSelectionBox(aabb3f *toset) const { return false; } - virtual bool collideWithObjects() const { return false; } -}; - void TestActiveObject::testAOAttributes() { - TestAO ao(44); + MockActiveObject ao(44); UASSERT(ao.getId() == 44); ao.setId(558); -- cgit v1.2.3