From 2594fdc7921c1333fe31be09678db965d82e21ef Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Thu, 27 Feb 2014 23:15:53 +0100 Subject: [PATCH] Annoying test project is now less annoying. --- Tests/Tests.vcxproj | 4 ++-- Tests/main.cpp | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Tests/Tests.vcxproj b/Tests/Tests.vcxproj index e1002f0..c013dba 100644 --- a/Tests/Tests.vcxproj +++ b/Tests/Tests.vcxproj @@ -39,12 +39,12 @@ - $(SolutionDir)\Escape-the-Dawn\;$(BOOST_ROOT);$(IncludePath) + $(SolutionDir)\Escape-the-Dawn\;$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(BOOST_ROOT);$(IncludePath) $(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath) $(ProjectDir)$(Configuration)\ - $(SolutionDir)\Escape-the-Dawn\;$(BOOST_ROOT);$(IncludePath) + $(SolutionDir)\Escape-the-Dawn\;$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(BOOST_ROOT);$(IncludePath) $(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath) $(ProjectDir)$(Configuration)\ diff --git a/Tests/main.cpp b/Tests/main.cpp index cf24dd8..6a335d1 100644 --- a/Tests/main.cpp +++ b/Tests/main.cpp @@ -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_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); } \ No newline at end of file