|
|
@@ -29,7 +29,7 @@ TEST(Helper, AsGroup) {
|
|
|
([](entt::group<entt::exclude_t<int>, entt::get_t<const char>, const double>) {})(entt::as_group{registry});
|
|
|
}
|
|
|
|
|
|
-TEST(Invoke, MemberFunction) {
|
|
|
+TEST(Helper, Invoke) {
|
|
|
entt::registry registry;
|
|
|
const auto entity = registry.create();
|
|
|
|
|
|
@@ -38,3 +38,22 @@ TEST(Invoke, MemberFunction) {
|
|
|
|
|
|
ASSERT_EQ(entity, registry.get<clazz>(entity).entt);
|
|
|
}
|
|
|
+
|
|
|
+TEST(Helper, ToEntity) {
|
|
|
+ entt::registry registry;
|
|
|
+ const auto entity = registry.create();
|
|
|
+ const auto other = registry.create();
|
|
|
+
|
|
|
+ registry.emplace<int>(entity);
|
|
|
+ registry.emplace<int>(other);
|
|
|
+ registry.emplace<char>(other);
|
|
|
+
|
|
|
+ ASSERT_EQ(entt::to_entity(registry, registry.get<int>(entity)), entity);
|
|
|
+ ASSERT_EQ(entt::to_entity(registry, registry.get<int>(other)), other);
|
|
|
+ ASSERT_EQ(entt::to_entity(registry, registry.get<char>(other)), other);
|
|
|
+
|
|
|
+ registry.destroy(entity);
|
|
|
+
|
|
|
+ ASSERT_EQ(entt::to_entity(registry, registry.get<int>(other)), other);
|
|
|
+ ASSERT_EQ(entt::to_entity(registry, registry.get<char>(other)), other);
|
|
|
+}
|