diff --git a/test/entt/entity/entity.cpp b/test/entt/entity/entity.cpp index b159cfda4..51a7c0a77 100644 --- a/test/entt/entity/entity.cpp +++ b/test/entt/entity/entity.cpp @@ -35,6 +35,8 @@ TEST(Entity, Traits) { TEST(Entity, Null) { using traits_type = entt::entt_traits; + constexpr entt::entity tombstone = entt::tombstone; + constexpr entt::entity null = entt::null; ASSERT_FALSE(entt::entity{} == entt::null); ASSERT_TRUE(entt::entity{traits_type::reserved()} == entt::null); @@ -46,8 +48,8 @@ TEST(Entity, Null) { const auto entity = registry.create(); ASSERT_EQ((entt::null | entity), (traits_type::to_type(entt::null, entity))); - ASSERT_EQ((entt::null | static_cast(entt::null)), static_cast(entt::null)); - ASSERT_EQ((entt::null | static_cast(entt::tombstone)), static_cast(entt::null)); + ASSERT_EQ((entt::null | null), null); + ASSERT_EQ((entt::null | tombstone), null); registry.emplace(entity, 42); @@ -65,6 +67,8 @@ TEST(Entity, Null) { TEST(Entity, Tombstone) { using traits_type = entt::entt_traits; + constexpr entt::entity tombstone = entt::tombstone; + constexpr entt::entity null = entt::null; ASSERT_FALSE(entt::entity{} == entt::tombstone); ASSERT_TRUE(entt::entity{traits_type::reserved()} == entt::tombstone); @@ -76,8 +80,8 @@ TEST(Entity, Tombstone) { const auto entity = registry.create(); ASSERT_EQ((entt::tombstone | entity), (traits_type::to_type(entity, entt::tombstone))); - ASSERT_EQ((entt::tombstone | static_cast(entt::tombstone)), static_cast(entt::tombstone)); - ASSERT_EQ((entt::tombstone | static_cast(entt::null)), static_cast(entt::tombstone)); + ASSERT_EQ((entt::tombstone | tombstone), tombstone); + ASSERT_EQ((entt::tombstone | null), tombstone); registry.emplace(entity, 42); diff --git a/test/example/custom_identifier.cpp b/test/example/custom_identifier.cpp index 39f80491f..3a8e57ca5 100644 --- a/test/example/custom_identifier.cpp +++ b/test/example/custom_identifier.cpp @@ -7,15 +7,15 @@ struct entity_id { using entity_type = std::uint32_t; static constexpr auto null = entt::null; - constexpr entity_id(entity_type value = null) + constexpr entity_id(entity_type value = null) ENTT_NOEXCEPT : entt{value} {} - constexpr entity_id(const entity_id &other) + constexpr entity_id(const entity_id &other) ENTT_NOEXCEPT : entt{other.entt} {} - constexpr operator entity_type() const { + constexpr operator entity_type() const ENTT_NOEXCEPT { return entt; }