3 Copyright (C) 2018 nerzhul, Loic BLOT <loic.blot@unix-experience.fr>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "activeobject.h"
24 class TestActiveObject : public TestBase
27 TestActiveObject() { TestManager::registerTestModule(this); }
28 const char *getName() { return "TestActiveObject"; }
30 void runTests(IGameDef *gamedef);
32 void testAOAttributes();
35 static TestActiveObject g_test_instance;
37 void TestActiveObject::runTests(IGameDef *gamedef)
39 TEST(testAOAttributes);
42 class TestAO : public ActiveObject
45 TestAO(u16 id) : ActiveObject(id) {}
47 virtual ActiveObjectType getType() const { return ACTIVEOBJECT_TYPE_TEST; }
48 virtual bool getCollisionBox(aabb3f *toset) const { return false; }
49 virtual bool getSelectionBox(aabb3f *toset) const { return false; }
50 virtual bool collideWithObjects() const { return false; }
53 void TestActiveObject::testAOAttributes()
56 UASSERT(ao.getId() == 44);
59 UASSERT(ao.getId() == 558);