From f4418e02051c83bec9986ae285bbd0d44fc2d491 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sat, 19 Feb 2022 10:46:18 +0100 Subject: [PATCH] test: increase code coverage --- test/entt/core/memory.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/entt/core/memory.cpp b/test/entt/core/memory.cpp index aa750c026..a89fab25c 100644 --- a/test/entt/core/memory.cpp +++ b/test/entt/core/memory.cpp @@ -69,12 +69,14 @@ TEST(Memory, FastMod) { } TEST(Memory, AllocateUnique) { - test::throwing_allocator allocator{}; - test::throwing_allocator::trigger_on_allocate = true; + test::throwing_allocator allocator{}; + test::throwing_allocator::trigger_on_allocate = true; + test::throwing_type::trigger_on_value = 0; - ASSERT_THROW((entt::allocate_unique(allocator, 0)), test::throwing_allocator::exception_type); + ASSERT_THROW((entt::allocate_unique(allocator, 0)), test::throwing_allocator::exception_type); + ASSERT_THROW((entt::allocate_unique(allocator, test::throwing_type{0})), test::throwing_type::exception_type); - std::unique_ptr>> ptr = entt::allocate_unique(allocator, 42); + std::unique_ptr>> ptr = entt::allocate_unique(allocator, 42); ASSERT_TRUE(ptr); ASSERT_EQ(*ptr, 42);