2014-02-10 13:09:16 +01:00
|
|
|
#include <boost/test/unit_test.hpp>
|
2016-04-15 02:06:10 +02:00
|
|
|
#include <data/Model.hpp>
|
2016-09-09 22:13:22 +02:00
|
|
|
#include "test_globals.hpp"
|
2014-02-10 13:09:16 +01:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(LoaderDFFTests)
|
|
|
|
|
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_load_dff) {
|
|
|
|
{
|
|
|
|
auto d = Global::get().e->data->index.openFile("landstal.dff");
|
2014-06-04 12:53:11 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
LoaderDFF loader;
|
2014-06-04 12:53:11 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
Model* m = loader.loadFromMemory(d);
|
2014-06-04 12:53:11 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE(m != nullptr);
|
2014-06-04 12:53:11 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE_EQUAL(m->frames.size(), 40);
|
2014-08-04 23:21:01 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE_EQUAL(m->geometries.size(), 16);
|
2014-08-04 23:21:01 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE_EQUAL(m->geometries[0]->subgeom.size(), 5);
|
2014-08-04 23:21:01 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
for (auto& g : m->geometries) {
|
|
|
|
BOOST_CHECK_GT(g->geometryBounds.radius, 0.f);
|
|
|
|
}
|
2014-08-04 23:21:01 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_REQUIRE(m->atomics.size() > 0);
|
2014-08-04 23:21:01 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
for (Model::Atomic& a : m->atomics) {
|
|
|
|
BOOST_CHECK(a.frame < m->frames.size());
|
|
|
|
BOOST_CHECK(a.geometry < m->geometries.size());
|
|
|
|
}
|
2014-06-04 12:53:11 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
delete m;
|
|
|
|
}
|
2014-06-04 12:53:11 +02:00
|
|
|
}
|
|
|
|
|
2016-06-16 22:11:55 +02:00
|
|
|
#endif
|
2014-02-10 13:09:16 +01:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|