1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-01 16:32:31 +01:00
openrw/tests/test_Cutscene.cpp

33 lines
884 B
C++
Raw Normal View History

#include <boost/test/unit_test.hpp>
#include <data/CutsceneData.hpp>
#include <loaders/LoaderCutsceneDAT.hpp>
#include <platform/FileHandle.hpp>
#include "test_Globals.hpp"
BOOST_AUTO_TEST_SUITE(CutsceneTests, DATA_TEST_PREDICATE)
2016-09-09 22:13:22 +02:00
BOOST_AUTO_TEST_CASE(test_load) {
{
auto d = Global::get().e->data->index.openFile("intro.dat");
2016-09-09 22:13:22 +02:00
CutsceneTracks tracks;
2016-09-09 22:13:22 +02:00
LoaderCutsceneDAT loader;
2016-09-09 22:13:22 +02:00
loader.load(tracks, d);
2016-09-09 22:13:22 +02:00
BOOST_CHECK(tracks.position.find(0.f) != tracks.position.end());
BOOST_CHECK(tracks.position.find(64.8f) != tracks.position.end());
2016-09-09 22:13:22 +02:00
BOOST_CHECK(tracks.zoom.find(64.8f) != tracks.zoom.end());
2016-09-09 22:13:22 +02:00
BOOST_CHECK(tracks.zoom.find(64.8f) != tracks.zoom.end());
2016-09-09 22:13:22 +02:00
BOOST_CHECK(tracks.target.find(64.8f) != tracks.target.end());
2016-09-09 22:13:22 +02:00
BOOST_CHECK(tracks.duration == 64.8f);
}
}
BOOST_AUTO_TEST_SUITE_END()