From afe942ef2e8a41f890fc8d7f4a1a93312a75c500 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 8 Nov 2023 12:38:16 +0100 Subject: [PATCH] test: use shared custom_entity type --- test/entt/entity/registry.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index e77c4ffa7..34d40a22f 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -15,6 +15,7 @@ #include #include "../common/aggregate.h" #include "../common/config.h" +#include "../common/custom_entity.h" #include "../common/empty.h" #include "../common/non_default_constructible.h" #include "../common/pointer_stable.h" @@ -73,10 +74,8 @@ private: bool *ctx_check{}; }; -enum class small_entity : std::uint32_t {}; - -struct small_entity_traits { - using value_type = small_entity; +struct custom_entity_traits { + using value_type = test::custom_entity; using entity_type = uint32_t; using version_type = uint16_t; static constexpr entity_type entity_mask = 0xFF; @@ -84,8 +83,7 @@ struct small_entity_traits { }; template<> -struct entt::entt_traits: entt::basic_entt_traits { - using base_type = entt::basic_entt_traits; +struct entt::entt_traits: entt::basic_entt_traits { static constexpr auto page_size = ENTT_SPARSE_PAGE; }; @@ -625,8 +623,8 @@ TEST(Registry, CreateDestroyReleaseCornerCase) { } ENTT_DEBUG_TEST(RegistryDeathTest, CreateTooManyEntities) { - entt::basic_registry registry; - std::vector entity(entt::entt_traits::to_entity(entt::null)); + entt::basic_registry registry; + std::vector entity(entt::entt_traits::to_entity(entt::null)); registry.create(entity.begin(), entity.end()); ASSERT_DEATH([[maybe_unused]] const auto entt = registry.create(), "");