Annoying test project is now less annoying.

This commit is contained in:
2014-02-27 23:15:53 +01:00
parent c8ab199c7c
commit 2594fdc792
2 changed files with 13 additions and 7 deletions
+11 -5
View File
@@ -1,11 +1,11 @@
#include "World.h"
#include "Components/Transform.h"
#define BOOST_TEST_MODULE MyTest
#define BOOST_TEST_MODULE World
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(my_test)
BOOST_AUTO_TEST_CASE(Parenting)
{
World world;
@@ -18,9 +18,15 @@ BOOST_AUTO_TEST_CASE(my_test)
BOOST_CHECK(ent2 != 0);
BOOST_CHECK(ent2 == ent1 + 1);
BOOST_CHECK(world.GetEntityParent(ent2) == ent1);
}
BOOST_AUTO_TEST_CASE(Recycling)
{
World world;
// EntityID recycling
world.RemoveEntity(ent2);
EntityID ent3 = world.CreateEntity();
BOOST_CHECK(ent2 == ent3);
EntityID ent11 = world.CreateEntity(); // 1
world.RemoveEntity(ent11);
EntityID ent12 = world.CreateEntity(); // 1
BOOST_REQUIRE(ent11 == ent12);
}