1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 19:32:49 +01:00
openrw/rwengine/tests/test_Resource.cpp
Daniel Evans d1e7dcdcd1 Overhaul Loader framework for Models
- Replace background model loader with generic background loader
- Replace ModelHandle object with generic resource handle
2015-04-03 03:04:50 +01:00

24 lines
566 B
C++

#include <boost/test/unit_test.hpp>
#include <data/ResourceHandle.hpp>
#include <test_globals.hpp>
typedef ResourceHandle<int>::Ref IntRef;
BOOST_AUTO_TEST_SUITE(ResourceTests)
BOOST_AUTO_TEST_CASE(test_ResourceHandle)
{
int resource = 42;
IntRef ref { new ResourceHandle<int>("") };
BOOST_CHECK_EQUAL( ref->resource, nullptr );
BOOST_CHECK_EQUAL( ref->state, RW::Loading );
ref->state = RW::Loaded;
ref->resource = &resource;
BOOST_CHECK_EQUAL( ref->resource, &resource );
BOOST_CHECK_EQUAL( ref->state, RW::Loaded );
}
BOOST_AUTO_TEST_SUITE_END()