mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-15 15:02:34 +02:00
more test
This commit is contained in:
parent
d58393f663
commit
00dd9ee31e
30
tests/test_archive.cpp
Normal file
30
tests/test_archive.cpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include <boost/test/unit_test.hpp>
|
||||||
|
#include "test_globals.hpp"
|
||||||
|
#include <loaders/LoaderIMG.hpp>
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE(ArchiveTests)
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(test_open_archive)
|
||||||
|
{
|
||||||
|
LoaderIMG loader;
|
||||||
|
|
||||||
|
BOOST_REQUIRE( loader.load("test_data/models/gta3") );
|
||||||
|
|
||||||
|
BOOST_CHECK( loader.getAssetCount() > 0 );
|
||||||
|
|
||||||
|
LoaderIMGFile& f = loader.getAssetInfoByIndex(0);
|
||||||
|
|
||||||
|
// A few assumptions..
|
||||||
|
|
||||||
|
BOOST_CHECK_EQUAL( f.name, "radar00.txd" );
|
||||||
|
BOOST_CHECK_EQUAL( f.offset, 0);
|
||||||
|
BOOST_CHECK_EQUAL( f.size, 33);
|
||||||
|
|
||||||
|
LoaderIMGFile& f2 = loader.getAssetInfo("radar00.txd");
|
||||||
|
|
||||||
|
BOOST_CHECK_EQUAL( f2.name, f.name );
|
||||||
|
BOOST_CHECK_EQUAL( f2.offset, f.offset );
|
||||||
|
BOOST_CHECK_EQUAL( f2.size, f.size );
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE_END()
|
@ -16,7 +16,7 @@ public:
|
|||||||
wnd.create(sf::VideoMode(640, 360), "Testing");
|
wnd.create(sf::VideoMode(640, 360), "Testing");
|
||||||
glewExperimental = GL_TRUE;
|
glewExperimental = GL_TRUE;
|
||||||
glewInit();
|
glewInit();
|
||||||
e = new GameWorld("data");
|
e = new GameWorld("test_data");
|
||||||
}
|
}
|
||||||
|
|
||||||
~Global() {
|
~Global() {
|
||||||
|
26
tests/test_loaderdff.cpp
Normal file
26
tests/test_loaderdff.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include <boost/test/unit_test.hpp>
|
||||||
|
#include "test_globals.hpp"
|
||||||
|
#include <render/Model.hpp>
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE(LoaderDFFTests)
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(test_open_dff)
|
||||||
|
{
|
||||||
|
LoaderIMG loader;
|
||||||
|
|
||||||
|
BOOST_REQUIRE( loader.load("test_data/models/gta3") );
|
||||||
|
|
||||||
|
auto d = loader.loadToMemory("landstal.dff");
|
||||||
|
|
||||||
|
LoaderDFF dffloader;
|
||||||
|
Model* m = dffloader.loadFromMemory(d, &Global::get().e->gameData);
|
||||||
|
|
||||||
|
BOOST_REQUIRE( m != nullptr );
|
||||||
|
|
||||||
|
BOOST_CHECK( m->frames.size() > 0 );
|
||||||
|
|
||||||
|
delete d;
|
||||||
|
delete m;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_SUITE_END()
|
@ -65,6 +65,11 @@ BOOST_AUTO_TEST_CASE(menu_test_active_index)
|
|||||||
|
|
||||||
test.activate();
|
test.activate();
|
||||||
|
|
||||||
|
BOOST_CHECK( clickindex == -1 );
|
||||||
|
|
||||||
|
test.move( 1);
|
||||||
|
test.activate();
|
||||||
|
|
||||||
BOOST_CHECK( clickindex == 0 );
|
BOOST_CHECK( clickindex == 0 );
|
||||||
|
|
||||||
test.move( 1);
|
test.move( 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user