diff options
author | savilli <78875209+savilli@users.noreply.github.com> | 2022-09-27 22:22:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 16:22:11 -0400 |
commit | 907dcdcf7bb513ecfeb1c988f071f497dcfbf765 (patch) | |
tree | 5ef19550e97f876f9a1d5eadbedc4c4de879d8a8 /src/unittest/test_activeobject.cpp | |
parent | 3f801bc096077a91094087fab4a4557198429851 (diff) | |
download | minetest-907dcdcf7bb513ecfeb1c988f071f497dcfbf765.tar.xz |
Add unittests for item movement code (#11885)
Diffstat (limited to 'src/unittest/test_activeobject.cpp')
-rw-r--r-- | src/unittest/test_activeobject.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
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); |