فهرست منبع

test: minor changes

Michele Caini 2 سال پیش
والد
کامیت
fb624bab50
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      test/entt/entity/handle.cpp

+ 3 - 2
test/entt/entity/handle.cpp

@@ -1,3 +1,4 @@
+#include <memory>
 #include <tuple>
 #include <type_traits>
 #include <utility>
@@ -212,7 +213,7 @@ TEST(BasicHandle, FromEntity) {
 TEST(BasicHandle, Lifetime) {
     entt::registry registry;
     const auto entity = registry.create();
-    auto *handle = new entt::handle{registry, entity};
+    auto handle = std::make_unique<entt::handle>(registry, entity);
     handle->emplace<int>();
 
     ASSERT_FALSE(registry.storage<int>().empty());
@@ -222,7 +223,7 @@ TEST(BasicHandle, Lifetime) {
         ASSERT_EQ(handle->entity(), entt);
     }
 
-    delete handle;
+    handle.reset();
 
     ASSERT_FALSE(registry.storage<int>().empty());
     ASSERT_NE(registry.storage<entt::entity>().free_list(), 0u);