Browse Source

test: avoid shadow variable warning

skypjack 9 months ago
parent
commit
ae7b3d87ee
1 changed files with 8 additions and 14 deletions
  1. 8 14
      test/entt/entity/component.cpp

+ 8 - 14
test/entt/entity/component.cpp

@@ -51,53 +51,47 @@ using EntityTypes = ::testing::Types<entt::entity, test::entity, test::other_ent
 TYPED_TEST_SUITE(Component, EntityTypes, );
 TYPED_TEST_SUITE(Component, EntityTypes, );
 
 
 TYPED_TEST(Component, VoidType) {
 TYPED_TEST(Component, VoidType) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<void, entity_type>;
+    using traits_type = entt::component_traits<void, typename TestFixture::entity_type>;
 
 
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_EQ(traits_type::page_size, 0u);
     ASSERT_EQ(traits_type::page_size, 0u);
 }
 }
 
 
 TYPED_TEST(Component, Empty) {
 TYPED_TEST(Component, Empty) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<test::empty, entity_type>;
+    using traits_type = entt::component_traits<test::empty, typename TestFixture::entity_type>;
 
 
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_EQ(traits_type::page_size, 0u);
     ASSERT_EQ(traits_type::page_size, 0u);
 }
 }
 
 
 TYPED_TEST(Component, NonEmpty) {
 TYPED_TEST(Component, NonEmpty) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<test::boxed_int, entity_type>;
+    using traits_type = entt::component_traits<test::boxed_int, typename TestFixture::entity_type>;
 
 
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_FALSE(traits_type::in_place_delete);
     ASSERT_EQ(traits_type::page_size, ENTT_PACKED_PAGE);
     ASSERT_EQ(traits_type::page_size, ENTT_PACKED_PAGE);
 }
 }
 
 
 TYPED_TEST(Component, NonMovable) {
 TYPED_TEST(Component, NonMovable) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<test::non_movable, entity_type>;
+    using traits_type = entt::component_traits<test::non_movable, typename TestFixture::entity_type>;
 
 
     ASSERT_TRUE(traits_type::in_place_delete);
     ASSERT_TRUE(traits_type::in_place_delete);
     ASSERT_EQ(traits_type::page_size, ENTT_PACKED_PAGE);
     ASSERT_EQ(traits_type::page_size, ENTT_PACKED_PAGE);
 }
 }
 
 
 TYPED_TEST(Component, SelfContained) {
 TYPED_TEST(Component, SelfContained) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<self_contained, entity_type>;
+    using traits_type = entt::component_traits<self_contained, typename TestFixture::entity_type>;
 
 
     ASSERT_TRUE(traits_type::in_place_delete);
     ASSERT_TRUE(traits_type::in_place_delete);
     ASSERT_EQ(traits_type::page_size, 4u);
     ASSERT_EQ(traits_type::page_size, 4u);
 }
 }
 
 
 TYPED_TEST(Component, TraitsBased) {
 TYPED_TEST(Component, TraitsBased) {
-    using entity_type = typename TestFixture::entity_type;
-    using traits_type = entt::component_traits<traits_based, entity_type>;
+    using traits_type = entt::component_traits<traits_based, typename TestFixture::entity_type>;
 
 
-    if constexpr(std::is_same_v<entity_type, entt::entity>) {
+    if constexpr(std::is_same_v<typename traits_type::entity_type, entt::entity>) {
         ASSERT_TRUE(traits_type::in_place_delete);
         ASSERT_TRUE(traits_type::in_place_delete);
         ASSERT_EQ(traits_type::page_size, 8u);
         ASSERT_EQ(traits_type::page_size, 8u);
-    } else if constexpr(std::is_same_v<entity_type, test::entity>) {
+    } else if constexpr(std::is_same_v<typename traits_type::entity_type, test::entity>) {
         ASSERT_FALSE(traits_type::in_place_delete);
         ASSERT_FALSE(traits_type::in_place_delete);
         ASSERT_EQ(traits_type::page_size, 16u);
         ASSERT_EQ(traits_type::page_size, 16u);
     } else {
     } else {