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

test: avoid using custom entities when emplacing in a registry - see #1095

Michele Caini 2 лет назад
Родитель
Сommit
872e0c6dde
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      test/entt/entity/view.cpp

+ 2 - 2
test/entt/entity/view.cpp

@@ -544,7 +544,7 @@ TEST(SingleComponentView, SwapStorage) {
     ASSERT_EQ(view.storage<0u>(), nullptr);
     ASSERT_EQ(cview.storage<const int>(), nullptr);
 
-    const entt::entity entity{4u};
+    const entt::entity entity{registry.create()};
     registry.emplace<int>(entity);
 
     view.storage(registry.storage<int>());
@@ -1509,7 +1509,7 @@ TEST(MultiComponentView, SwapStorage) {
     ASSERT_EQ(view.storage<0u>(), nullptr);
     ASSERT_EQ(view.storage<const char>(), nullptr);
 
-    const entt::entity entity{4u};
+    const entt::entity entity{registry.create()};
     registry.emplace<int>(entity);
     registry.emplace<char>(entity);