2014-09-17 04:13:02 +02:00
|
|
|
#include <boost/test/unit_test.hpp>
|
2016-09-03 05:11:55 +02:00
|
|
|
#include <data/ModelData.hpp>
|
2014-09-17 04:13:02 +02:00
|
|
|
#include "test_globals.hpp"
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(ObjectDataTests)
|
|
|
|
|
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) {
|
|
|
|
{
|
|
|
|
LoaderIDE l;
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
l.load(Global::get().getGamePath() + "/data/maps/generic.ide");
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_ASSERT(l.objects.find(1100) != l.objects.end());
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
auto obj = l.objects[1100];
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
auto def = std::dynamic_pointer_cast<ObjectData>(obj);
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_ASSERT(def->class_type == ObjectInformation::_class("OBJS"));
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK_EQUAL(def->modelName, "rd_Corner1");
|
|
|
|
BOOST_CHECK_EQUAL(def->textureName, "generic");
|
|
|
|
BOOST_CHECK_EQUAL(def->numClumps, 1);
|
|
|
|
BOOST_CHECK_EQUAL(def->drawDistance[0], 220);
|
|
|
|
BOOST_CHECK_EQUAL(def->flags, 0);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
LoaderIDE l;
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
l.load(Global::get().getGamePath() + "/data/default.ide");
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_ASSERT(l.objects.find(90) != l.objects.end());
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
auto obj = l.objects[90];
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
auto def = std::dynamic_pointer_cast<VehicleData>(obj);
|
2014-09-17 04:13:02 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_ASSERT(def->class_type == ObjectInformation::_class("CARS"));
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK_EQUAL(def->modelName, "landstal");
|
|
|
|
BOOST_CHECK_EQUAL(def->textureName, "landstal");
|
|
|
|
BOOST_CHECK_EQUAL(def->type, VehicleData::CAR);
|
|
|
|
BOOST_CHECK_EQUAL(def->handlingID, "LANDSTAL");
|
|
|
|
BOOST_CHECK_EQUAL(def->gameName, "LANDSTK");
|
|
|
|
BOOST_CHECK_EQUAL(def->classType, VehicleData::RICHFAMILY);
|
|
|
|
BOOST_CHECK_EQUAL(def->frequency, 10);
|
|
|
|
BOOST_CHECK_EQUAL(def->wheelModelID, 164);
|
|
|
|
BOOST_CHECK_CLOSE(def->wheelScale, 0.8f, 0.01f);
|
|
|
|
}
|
2014-09-17 04:13:02 +02:00
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(test_gamedata_data) {
|
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
|
|
|
|
2014-09-17 04:13:02 +02:00
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|