2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2018 nerzhul, Loic BLOT <loic.blot@unix-experience.fr>
|
2018-01-01 18:48:52 +01:00
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
2022-09-27 22:22:11 +02:00
|
|
|
#include "mock_activeobject.h"
|
2018-01-01 18:48:52 +01:00
|
|
|
|
|
|
|
class TestActiveObject : public TestBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestActiveObject() { TestManager::registerTestModule(this); }
|
|
|
|
const char *getName() { return "TestActiveObject"; }
|
|
|
|
|
|
|
|
void runTests(IGameDef *gamedef);
|
|
|
|
|
|
|
|
void testAOAttributes();
|
|
|
|
};
|
|
|
|
|
|
|
|
static TestActiveObject g_test_instance;
|
|
|
|
|
|
|
|
void TestActiveObject::runTests(IGameDef *gamedef)
|
|
|
|
{
|
|
|
|
TEST(testAOAttributes);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestActiveObject::testAOAttributes()
|
|
|
|
{
|
2022-09-27 22:22:11 +02:00
|
|
|
MockActiveObject ao(44);
|
2018-01-01 18:48:52 +01:00
|
|
|
UASSERT(ao.getId() == 44);
|
|
|
|
|
|
|
|
ao.setId(558);
|
|
|
|
UASSERT(ao.getId() == 558);
|
|
|
|
}
|