Sfoglia il codice sorgente

test: internal changes

skypjack 1 settimana fa
parent
commit
60ada2efb7

+ 3 - 1
test/CMakeLists.txt

@@ -290,10 +290,12 @@ SETUP_BASIC_TEST(
         entt/entity/view.cpp
         entt/entity/view.cpp
 )
 )
 
 
+# Test entity_no_mixin
+
 SETUP_BASIC_TEST(
 SETUP_BASIC_TEST(
     NAME entity_no_mixin
     NAME entity_no_mixin
     SOURCES
     SOURCES
-        entt/entity/storage_utility.cpp
+        entt/entity_no_mixin/storage_utility.cpp
     DEFS ENTT_NO_MIXIN
     DEFS ENTT_NO_MIXIN
 )
 )
 
 

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

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

+ 29 - 0
test/entt/entity_no_mixin/storage_utility.cpp

@@ -0,0 +1,29 @@
+#include <gtest/gtest.h>
+#include <entt/entity/storage.hpp>
+
+template<typename Type>
+struct StorageUtility: testing::Test {
+    using type = Type;
+};
+
+using StorageUtilityTypes = ::testing::Types<int, char, double, void>;
+
+TYPED_TEST_SUITE(StorageUtility, StorageUtilityTypes, );
+
+TYPED_TEST(StorageUtility, StorageType) {
+    using value_type = TestFixture::type;
+
+    // just a bunch of static asserts to avoid regressions
+    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>>();
+}
+
+TYPED_TEST(StorageUtility, StorageFor) {
+    using value_type = TestFixture::type;
+
+    // just a bunch of static asserts to avoid regressions
+    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>>();
+}