Просмотр исходного кода

test: more about meta type aliases

skypjack 5 дней назад
Родитель
Сommit
a75ca174b9
1 измененных файлов с 11 добавлено и 3 удалено
  1. 11 3
      test/entt/meta/meta_factory.cpp

+ 11 - 3
test/entt/meta/meta_factory.cpp

@@ -152,14 +152,22 @@ ENTT_DEBUG_TEST_F(MetaFactoryDeathTest, Type) {
     using namespace entt::literals;
     using namespace entt::literals;
 
 
     entt::meta_factory<int> factory{};
     entt::meta_factory<int> factory{};
-    entt::meta_factory<int> overloaded{"overloaded"_hs};
     entt::meta_factory<double> other{};
     entt::meta_factory<double> other{};
 
 
     factory.type("foo"_hs);
     factory.type("foo"_hs);
-    overloaded.type("bar"_hs);
 
 
     ASSERT_DEATH(other.type("foo"_hs), "");
     ASSERT_DEATH(other.type("foo"_hs), "");
-    ASSERT_DEATH(other.type("overloaded"_hs), "");
+    ASSERT_DEATH(factory.type(entt::type_hash<double>::value()), "");
+}
+
+ENTT_DEBUG_TEST_F(MetaFactoryDeathTest, OverloadedType) {
+    using namespace entt::literals;
+
+    entt::meta_factory<int> factory{};
+    entt::meta_factory<double> other{"overloaded"_hs};
+
+    ASSERT_DEATH(other.type(entt::type_hash<int>::value()), "");
+    ASSERT_DEATH(factory.type("overloaded"_hs), "");
 }
 }
 
 
 TEST_F(MetaFactory, Base) {
 TEST_F(MetaFactory, Base) {