2017-01-18 00:57:20 +01:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <loaders/LoaderIPL.hpp>
|
2017-10-26 03:51:24 +02:00
|
|
|
#include "test_Globals.hpp"
|
2017-01-18 00:57:20 +01:00
|
|
|
|
2018-08-07 00:02:07 +02:00
|
|
|
struct WithLoaderIPL {
|
|
|
|
LoaderIPL loader;
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_FIXTURE_TEST_SUITE(LoaderIPLTests, WithLoaderIPL)
|
2017-01-18 00:57:20 +01:00
|
|
|
|
|
|
|
#if RW_TEST_WITH_DATA
|
2018-08-07 00:25:03 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(zone_count_is_correct) {
|
2017-01-18 00:57:20 +01:00
|
|
|
const auto& gdpath = Global::get().getGamePath();
|
|
|
|
BOOST_REQUIRE(loader.load(gdpath + "/data/gta3.zon"));
|
|
|
|
|
2018-08-07 00:25:03 +02:00
|
|
|
BOOST_TEST(loader.zones.size() == 42);
|
2017-01-18 00:57:20 +01:00
|
|
|
}
|
|
|
|
|
2018-08-07 00:25:03 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(zone_data_is_correct) {
|
|
|
|
const auto& gdpath = Global::get().getGamePath();
|
|
|
|
BOOST_REQUIRE(loader.load(gdpath + "/data/gta3.zon"));
|
|
|
|
|
|
|
|
auto& zone1 = loader.zones[1];
|
|
|
|
BOOST_TEST(zone1.name == "PORT_W");
|
|
|
|
BOOST_TEST(zone1.type == 0);
|
|
|
|
BOOST_TEST(zone1.min.x == 751.68f);
|
|
|
|
BOOST_TEST(zone1.island == 1);
|
|
|
|
}
|
2017-01-18 00:57:20 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|