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);