Răsfoiți Sursa

test: use sparse set generic bind function

Michele Caini 1 an în urmă
părinte
comite
19da9d2358
2 a modificat fișierele cu 9 adăugiri și 8 ștergeri
  1. 7 7
      test/entt/entity/sigh_mixin.cpp
  2. 2 1
      test/entt/entity/sparse_set.cpp

+ 7 - 7
test/entt/entity/sigh_mixin.cpp

@@ -322,7 +322,7 @@ TYPED_TEST(SighMixin, Move) {
     std::size_t on_construct{};
     std::size_t on_destroy{};
 
-    pool.bind(entt::forward_as_any(registry));
+    pool.bind(registry);
     pool.on_construct().template connect<&listener<entt::registry>>(on_construct);
     pool.on_destroy().template connect<&listener<entt::registry>>(on_destroy);
 
@@ -355,7 +355,7 @@ TYPED_TEST(SighMixin, Move) {
     ASSERT_EQ(pool.get(entt::entity{3}), value_type{3});
 
     other = entt::sigh_mixin<entt::storage<value_type>>{};
-    other.bind(entt::forward_as_any(registry));
+    other.bind(registry);
 
     other.emplace(entt::entity{1}, 1);
     other = std::move(pool);
@@ -384,11 +384,11 @@ TYPED_TEST(SighMixin, Swap) {
     std::size_t on_construct{};
     std::size_t on_destroy{};
 
-    pool.bind(entt::forward_as_any(registry));
+    pool.bind(registry);
     pool.on_construct().template connect<&listener<entt::registry>>(on_construct);
     pool.on_destroy().template connect<&listener<entt::registry>>(on_destroy);
 
-    other.bind(entt::forward_as_any(registry));
+    other.bind(registry);
     other.on_construct().template connect<&listener<entt::registry>>(on_construct);
     other.on_destroy().template connect<&listener<entt::registry>>(on_destroy);
 
@@ -460,7 +460,7 @@ TYPED_TEST(SighMixin, CustomAllocator) {
     std::size_t on_construct{};
     std::size_t on_destroy{};
 
-    pool.bind(entt::forward_as_any(registry));
+    pool.bind(registry);
     pool.on_construct().template connect<&listener<registry_type>>(on_construct);
     pool.on_destroy().template connect<&listener<registry_type>>(on_destroy);
 
@@ -521,7 +521,7 @@ TYPED_TEST(SighMixin, ThrowingAllocator) {
     std::size_t on_construct{};
     std::size_t on_destroy{};
 
-    pool.bind(entt::forward_as_any(registry));
+    pool.bind(registry);
     pool.on_construct().template connect<&listener<registry_type>>(on_construct);
     pool.on_destroy().template connect<&listener<registry_type>>(on_destroy);
 
@@ -589,7 +589,7 @@ TEST(SighMixin, ThrowingComponent) {
     std::size_t on_construct{};
     std::size_t on_destroy{};
 
-    pool.bind(entt::forward_as_any(registry));
+    pool.bind(registry);
     pool.on_construct().connect<&listener<registry_type>>(on_construct);
     pool.on_destroy().connect<&listener<registry_type>>(on_destroy);
 

+ 2 - 1
test/entt/entity/sparse_set.cpp

@@ -441,7 +441,8 @@ TYPED_TEST(SparseSet, Bind) {
     for(const auto policy: this->deletion_policy) {
         sparse_set_type set{policy};
 
-        ASSERT_NO_THROW(set.bind(entt::any{}));
+        ASSERT_NO_THROW(set.bind(0));
+        ASSERT_NO_THROW(set.bind(entt::make_any<int>(0)));
     }
 }