Przeglądaj źródła

test: ENTT_NO_MIXIN

Michele Caini 1 rok temu
rodzic
commit
9edeb731f5
2 zmienionych plików z 13 dodań i 0 usunięć
  1. 1 0
      test/CMakeLists.txt
  2. 12 0
      test/entt/entity/storage_utility.cpp

+ 1 - 0
test/CMakeLists.txt

@@ -262,6 +262,7 @@ SETUP_BASIC_TEST(storage entt/entity/storage.cpp)
 SETUP_BASIC_TEST(storage_entity entt/entity/storage_entity.cpp)
 SETUP_BASIC_TEST(storage_no_instance entt/entity/storage_no_instance.cpp)
 SETUP_BASIC_TEST(storage_utility entt/entity/storage_utility.cpp)
+SETUP_BASIC_TEST(storage_utility_no_mixin entt/entity/storage_utility.cpp ENTT_NO_MIXIN)
 SETUP_BASIC_TEST(table entt/entity/table.cpp)
 SETUP_BASIC_TEST(view entt/entity/view.cpp)
 

+ 12 - 0
test/entt/entity/storage_utility.cpp

@@ -14,16 +14,28 @@ TYPED_TEST(StorageUtility, StorageType) {
     using value_type = typename TestFixture::type;
 
     // just a bunch of static asserts to avoid regressions
+#ifdef ENTT_NO_MIXIN
+    testing::StaticAssertTypeEq<entt::storage_type_t<value_type, entt::entity>, entt::basic_storage<value_type, entt::entity>>();
+    testing::StaticAssertTypeEq<entt::storage_type_t<value_type>, entt::storage<value_type>>();
+#else
     testing::StaticAssertTypeEq<entt::storage_type_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
     testing::StaticAssertTypeEq<entt::storage_type_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
+#endif // ENTT_NO_MIXIN
 }
 
 TYPED_TEST(StorageUtility, StorageFor) {
     using value_type = typename TestFixture::type;
 
     // just a bunch of static asserts to avoid regressions
+#ifdef ENTT_NO_MIXIN
+    testing::StaticAssertTypeEq<entt::storage_for_t<const value_type, entt::entity>, const entt::basic_storage<value_type, entt::entity>>();
+    testing::StaticAssertTypeEq<entt::storage_for_t<value_type, entt::entity>, entt::basic_storage<value_type, entt::entity>>();
+    testing::StaticAssertTypeEq<entt::storage_for_t<const value_type>, const entt::storage<value_type>>();
+    testing::StaticAssertTypeEq<entt::storage_for_t<value_type>, entt::storage<value_type>>();
+#else
     testing::StaticAssertTypeEq<entt::storage_for_t<const value_type, entt::entity>, const entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
     testing::StaticAssertTypeEq<entt::storage_for_t<value_type, entt::entity>, entt::sigh_mixin<entt::basic_storage<value_type, entt::entity>>>();
     testing::StaticAssertTypeEq<entt::storage_for_t<const value_type>, const entt::sigh_mixin<entt::storage<value_type>>>();
     testing::StaticAssertTypeEq<entt::storage_for_t<value_type>, entt::sigh_mixin<entt::storage<value_type>>>();
+#endif
 }