2014-02-10 13:09:16 +01:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <loaders/LoaderIMG.hpp>
|
2017-10-26 03:51:24 +02:00
|
|
|
#include "test_Globals.hpp"
|
2014-02-10 13:09:16 +01:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(ArchiveTests)
|
|
|
|
|
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_open_archive) {
|
|
|
|
LoaderIMG archive;
|
|
|
|
|
|
|
|
BOOST_REQUIRE(archive.load(Global::getGamePath() + "/models/gta3"));
|
|
|
|
|
|
|
|
BOOST_CHECK(archive.getAssetCount() > 0);
|
|
|
|
|
|
|
|
LoaderIMGFile f, f2;
|
|
|
|
|
|
|
|
f = archive.getAssetInfoByIndex(0);
|
|
|
|
|
|
|
|
// A few assumptions..
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(f.name, "radar00.txd");
|
|
|
|
BOOST_CHECK_EQUAL(f.offset, 0);
|
|
|
|
BOOST_CHECK_EQUAL(f.size, 33);
|
|
|
|
|
|
|
|
BOOST_CHECK(archive.findAssetInfo("radar00.txd", f2));
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(f2.name, f.name);
|
|
|
|
BOOST_CHECK_EQUAL(f2.offset, f.offset);
|
|
|
|
BOOST_CHECK_EQUAL(f2.size, f.size);
|
2014-02-10 13:09:16 +01:00
|
|
|
}
|
2016-06-16 22:11:55 +02:00
|
|
|
#endif
|
2014-02-10 13:09:16 +01:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|