1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-02 00:42:33 +01:00
openrw/tests/test_Items.cpp

29 lines
731 B
C++
Raw Normal View History

#include <boost/test/unit_test.hpp>
#include <objects/CharacterObject.hpp>
#include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(ItemsTests, DATA_TEST_PREDICATE)
2016-09-09 22:13:22 +02:00
BOOST_AUTO_TEST_CASE(test_character_inventory) {
{
auto character = Global::get().e->createPedestrian(1, {0.f, 0.f, 0.f});
BOOST_REQUIRE(character != nullptr);
character->addToInventory(1, 10);
BOOST_CHECK_EQUAL(character->getActiveItem(), 0);
character->setActiveItem(1);
BOOST_CHECK_EQUAL(character->getActiveItem(), 1);
character->removeFromInventory(1);
BOOST_CHECK_EQUAL(character->getActiveItem(), 0);
2016-09-09 22:13:22 +02:00
Global::get().e->destroyObject(character);
}
}
BOOST_AUTO_TEST_SUITE_END()