Browse Source

test: minor changes

Michele Caini 2 years ago
parent
commit
678131429b
2 changed files with 5 additions and 13 deletions
  1. 4 7
      test/entt/entity/storage.cpp
  2. 1 6
      test/entt/signal/sigh.cpp

+ 4 - 7
test/entt/entity/storage.cpp

@@ -1664,9 +1664,10 @@ TYPED_TEST(Storage, ReferencesGuaranteed) {
 }
 
 TEST(Storage, UpdateFromDestructor) {
-    auto test = [](const auto target) {
-        constexpr auto size = 10u;
+    constexpr auto size = 10u;
+    const entt::entity entity[3u]{entt::entity{9u}, entt::entity{8u}, entt::entity{0u}};
 
+    for(auto target: entity) {
         entt::storage<update_from_destructor> pool;
 
         for(std::size_t next{}; next < size; ++next) {
@@ -1687,11 +1688,7 @@ TEST(Storage, UpdateFromDestructor) {
         for(std::size_t next{}; next < size; ++next) {
             ASSERT_FALSE(pool.contains(entt::entity(next)));
         }
-    };
-
-    test(entt::entity{9u});
-    test(entt::entity{8u});
-    test(entt::entity{0u});
+    }
 }
 
 TEST(Storage, CreateFromConstructor) {

+ 1 - 6
test/entt/signal/sigh.cpp

@@ -240,13 +240,8 @@ TEST(SigH, CollectorVoid) {
     ASSERT_FALSE(sigh.empty());
     ASSERT_EQ(cnt, 2);
 
-    auto test = [&cnt]() {
-        ++cnt;
-        return true;
-    };
-
     cnt = 0;
-    sigh.collect(std::move(test), 42);
+    sigh.collect([&cnt]() { ++cnt; return true; }, 42);
 
     ASSERT_EQ(cnt, 1);
 }