From d6f4bc99097d2fa499b89c35e512c744fe3b2e44 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 24 Sep 2024 08:34:20 +0200 Subject: [PATCH] test: reactive mixin ctors --- test/entt/entity/reactive_mixin.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/entt/entity/reactive_mixin.cpp b/test/entt/entity/reactive_mixin.cpp index c649b97bf..08842f040 100644 --- a/test/entt/entity/reactive_mixin.cpp +++ b/test/entt/entity/reactive_mixin.cpp @@ -1,4 +1,8 @@ +#include #include +#include +#include +#include template struct ReactiveMixin: testing::Test { using type = Type; @@ -12,3 +16,20 @@ using ReactiveMixinTypes = ::testing::Types; TYPED_TEST_SUITE(ReactiveMixin, ReactiveMixinTypes, ); TYPED_TEST_SUITE(ReactiveMixinDeathTest, ReactiveMixinTypes, ); +TYPED_TEST(ReactiveMixin, Constructors) { + using value_type = typename TestFixture::type; + using traits_type = entt::component_traits; + + entt::reactive_mixin> pool; + + ASSERT_EQ(pool.policy(), entt::deletion_policy{traits_type::in_place_delete}); + ASSERT_NO_THROW([[maybe_unused]] auto alloc = pool.get_allocator()); + ASSERT_EQ(pool.type(), entt::type_id()); + + pool = entt::reactive_mixin>{std::allocator{}}; + + ASSERT_EQ(pool.policy(), entt::deletion_policy{traits_type::in_place_delete}); + ASSERT_NO_THROW([[maybe_unused]] auto alloc = pool.get_allocator()); + ASSERT_EQ(pool.type(), entt::type_id()); +} +