2014-07-24 00:57:21 +02:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <script/SCMFile.hpp>
|
2016-09-09 22:13:22 +02:00
|
|
|
#include <script/ScriptMachine.hpp>
|
2014-07-24 00:57:21 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
SCMByte data[] = {0x02, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
|
|
|
|
0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x28, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
2014-07-24 00:57:21 +02:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(ScriptMachineTests)
|
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(scmfile_test) {
|
|
|
|
SCMFile f;
|
|
|
|
f.loadFile(data, sizeof(data));
|
2014-07-24 00:57:21 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK_EQUAL(f.getModelSection(), 0x10);
|
|
|
|
BOOST_CHECK_EQUAL(f.getMissionSection(), 0x20);
|
|
|
|
BOOST_CHECK_EQUAL(f.getCodeSection(), 0x28);
|
2014-07-24 00:57:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|