mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
28 lines
710 B
C++
28 lines
710 B
C++
#include <boost/test/unit_test.hpp>
|
|
#include <glm/gtx/string_cast.hpp>
|
|
#include <objects/InstanceObject.hpp>
|
|
#include "test_globals.hpp"
|
|
|
|
BOOST_AUTO_TEST_SUITE(LifetimeTests)
|
|
|
|
BOOST_AUTO_TEST_CASE(test_cleanup)
|
|
{
|
|
GameObject* f = Global::get().e->createInstance(1337, glm::vec3(0.f, 0.f, 1000.f));
|
|
auto id = f->getGameObjectID();
|
|
|
|
f->setLifetime(GameObject::TrafficLifetime);
|
|
|
|
{
|
|
auto search = Global::get().e->objects.find( id );
|
|
BOOST_CHECK( search != Global::get().e->objects.end() );
|
|
}
|
|
|
|
Global::get().e->cleanupTraffic(glm::vec3(0.f, 0.f, 0.f));
|
|
|
|
{
|
|
auto search = Global::get().e->objects.find( id );
|
|
BOOST_CHECK( search == Global::get().e->objects.end() );
|
|
}
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END() |