include_directories(${CMAKE_CURRENT_LIST_DIR})
-set(ENTITYX_BUILD_TESTING false CACHE BOOL "Enable building of tests.")
+set(ENTITYX_BUILD_TESTING true CACHE BOOL "Enable building of tests.")
set(ENTITYX_RUN_BENCHMARKS false CACHE BOOL "Run benchmarks (in conjunction with -DENTITYX_BUILD_TESTING=1).")
set(ENTITYX_MAX_COMPONENTS 64 CACHE STRING "Set the maximum number of components.")
set(ENTITYX_DT_TYPE double CACHE STRING "The type used for delta time in EntityX update methods.")
test.destroy();
REQUIRE(freed == true);
}
+
+TEST_CASE_METHOD(EntityManagerFixture, "TestComponentsRemovedFromReusedEntities") {
+ Entity a = em.create();
+ Entity::Id aid = a.id();
+ a.assign<Position>(1, 2);
+ a.destroy();
+
+ Entity b = em.create();
+ Entity::Id bid = b.id();
+
+ REQUIRE(aid.index() == bid.index());
+ REQUIRE(!b.has_component<Position>());
+ b.assign<Position>(3, 4);
+}