1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 20:32:43 +01:00
openrw/tests/test_rwbstream.cpp
Daniel Evans 46cd7b8f51 Overhaul Loader framework for Models
- Replace background model loader with generic background loader
- Replace ModelHandle object with generic resource handle
2015-03-06 04:38:22 +00:00

32 lines
705 B
C++

#include <boost/test/unit_test.hpp>
#include "test_globals.hpp"
#include <loaders/rwbinarystream.h>
BOOST_AUTO_TEST_SUITE(RWBStreamTests)
BOOST_AUTO_TEST_CASE(iterate_stream_test)
{
{
auto d = Global::get().e->gameData.openFile("landstal.dff");
RWBStream stream(d->data, d->length);
RWBStream::ChunkID id = stream.getNextChunk();
BOOST_REQUIRE_EQUAL( id, 0x0010 );
auto inner = stream.getInnerStream();
auto inner1 = inner.getNextChunk();
BOOST_REQUIRE_EQUAL( inner1, 0x0001 );
auto innerCursor = inner.getCursor();
// This is a value inside in the Clump's struct header section.
BOOST_CHECK_EQUAL( *(std::uint32_t*)innerCursor, 0x10 );
}
}
BOOST_AUTO_TEST_SUITE_END()