2015-04-24 19:09:21 +02:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <engine/GameData.hpp>
|
|
|
|
#include <test_globals.hpp>
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(GameDataTests)
|
|
|
|
|
2016-06-16 22:11:55 +02:00
|
|
|
#if RW_TEST_WITH_DATA
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(test_object_data) {
|
2016-12-02 01:56:38 +01:00
|
|
|
GameData gd(&Global::get().log, Global::getGamePath());
|
|
|
|
GameWorld gw(&Global::get().log, &gd);
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
gd.load();
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
{
|
2016-09-11 03:58:00 +02:00
|
|
|
auto def = gd.findModelInfo<SimpleModelInfo>(1100);
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE(def);
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-09-11 03:58:00 +02:00
|
|
|
BOOST_ASSERT(def->type() == ModelDataType::SimpleInfo);
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-09-11 03:58:00 +02:00
|
|
|
BOOST_CHECK_EQUAL(def->name, "rd_Corner1");
|
|
|
|
BOOST_CHECK_EQUAL(def->textureslot, "generic");
|
|
|
|
BOOST_CHECK_EQUAL(def->getNumAtomics(), 1);
|
|
|
|
BOOST_CHECK_EQUAL(def->getLodDistance(0), 220);
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK_EQUAL(def->flags, 0);
|
|
|
|
}
|
2015-04-24 19:09:21 +02:00
|
|
|
}
|
2016-06-16 22:11:55 +02:00
|
|
|
#endif
|
2015-04-24 19:09:21 +02:00
|
|
|
|
2016-06-16 22:11:55 +02:00
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|