From bc3dae2a68812d05c4b187a79d75cb16254b236e Mon Sep 17 00:00:00 2001 From: Evgeniy Smirnov Date: Wed, 11 May 2022 17:44:45 +0300 Subject: [PATCH] possible fix for codecov issue --- test/entt/entity/polymorphic.cpp | 72 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/test/entt/entity/polymorphic.cpp b/test/entt/entity/polymorphic.cpp index 913670feac..e45bb8be0c 100644 --- a/test/entt/entity/polymorphic.cpp +++ b/test/entt/entity/polymorphic.cpp @@ -31,22 +31,22 @@ TEST(PolyGetAny, Functionalities) { TEST(PolyGetAnyPointer, Functionalities) { entt::registry reg; - cat cat1; - dog dog1; - dog dog2; - cube cube2; - sphere sphere2; - fat_cat fat_cat3; + auto cat1 = std::make_unique(); + auto dog1 = std::make_unique(); + auto dog2 = std::make_unique(); + auto cube2 = std::make_unique(); + auto sphere2 = std::make_unique(); + auto fat_cat3 = std::make_unique(); entt::entity entity1 = reg.create(); // components: cat, dog entt::entity entity2 = reg.create(); // components: dog, sphere, cube entt::entity entity3 = reg.create(); // components: fat_cat - reg.emplace(entity1, &cat1); - reg.emplace(entity1, &dog1); - reg.emplace(entity2, &dog2); - reg.emplace(entity2, &cube2); - reg.emplace(entity2, &sphere2); - reg.emplace(entity3, &fat_cat3); + reg.emplace(entity1, cat1.get()); + reg.emplace(entity1, dog1.get()); + reg.emplace(entity2, dog2.get()); + reg.emplace(entity2, cube2.get()); + reg.emplace(entity2, sphere2.get()); + reg.emplace(entity3, fat_cat3.get()); ASSERT_EQ(entt::algorithm::poly_get_any(reg, entity1), nullptr); ASSERT_EQ(entt::algorithm::poly_get_any(reg, entity1), reg.get(entity1)); @@ -129,22 +129,22 @@ TEST(PolyGetAll, Functionalities) { TEST(PolyGetAllPointers, Functionalities) { entt::registry reg; - cat cat1; - dog dog1; - dog dog2; - cube cube2; - sphere sphere2; - fat_cat fat_cat3; + auto cat1 = std::make_unique(); + auto dog1 = std::make_unique(); + auto dog2 = std::make_unique(); + auto cube2 = std::make_unique(); + auto sphere2 = std::make_unique(); + auto fat_cat3 = std::make_unique(); entt::entity entity1 = reg.create(); // components: cat(payload=1), dog(payload=2) entt::entity entity2 = reg.create(); // components: dog(payload=2), cube(payload=3), sphere(payload=4) entt::entity entity3 = reg.create(); // components: fat_cat(both payloads = 5) - reg.emplace(entity1, &cat1)->animal_payload = 1; - reg.emplace(entity1, &dog1)->animal_payload = 2; - reg.emplace(entity2, &dog2)->animal_payload = 2; - reg.emplace(entity2, &cube2)->shape_payload = 3; - reg.emplace(entity2, &sphere2)->shape_payload = 4; - auto* c = reg.emplace(entity3, &fat_cat3); + reg.emplace(entity1, cat1.get())->animal_payload = 1; + reg.emplace(entity1, dog1.get())->animal_payload = 2; + reg.emplace(entity2, dog2.get())->animal_payload = 2; + reg.emplace(entity2, cube2.get())->shape_payload = 3; + reg.emplace(entity2, sphere2.get())->shape_payload = 4; + auto* c = reg.emplace(entity3, fat_cat3.get()); c->animal_payload = c->shape_payload = 5; { @@ -300,22 +300,22 @@ TEST(PolyEach, Functionalities) { TEST(PolyEachPointer, Functionalities) { entt::registry reg; - cat cat1; - dog dog1; - dog dog2; - cube cube2; - sphere sphere2; - fat_cat fat_cat3; + auto cat1 = std::make_unique(); + auto dog1 = std::make_unique(); + auto dog2 = std::make_unique(); + auto cube2 = std::make_unique(); + auto sphere2 = std::make_unique(); + auto fat_cat3 = std::make_unique(); entt::entity entity1 = reg.create(); // components: cat(payload=1), dog(payload=2) entt::entity entity2 = reg.create(); // components: dog(payload=2), cube(payload=3), sphere(payload=4) entt::entity entity3 = reg.create(); // components: fat_cat(both payloads = 5) - reg.emplace(entity1, &cat1)->animal_payload = 1; - reg.emplace(entity1, &dog1)->animal_payload = 2; - reg.emplace(entity2, &dog2)->animal_payload = 2; - reg.emplace(entity2, &cube2)->shape_payload = 3; - reg.emplace(entity2, &sphere2)->shape_payload = 4; - auto* c = reg.emplace(entity3, &fat_cat3); + reg.emplace(entity1, cat1.get())->animal_payload = 1; + reg.emplace(entity1, dog1.get())->animal_payload = 2; + reg.emplace(entity2, dog2.get())->animal_payload = 2; + reg.emplace(entity2, cube2.get())->shape_payload = 3; + reg.emplace(entity2, sphere2.get())->shape_payload = 4; + auto* c = reg.emplace(entity3, fat_cat3.get()); c->animal_payload = c->shape_payload = 5; {