From c8a07015974a363756000c058d3c360334914ce2 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 31 Oct 2023 09:18:36 +0100 Subject: [PATCH] test: use shared non default constructible type --- test/entt/core/compressed_pair.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/test/entt/core/compressed_pair.cpp b/test/entt/core/compressed_pair.cpp index 3fe0207a8..45a6f9a3a 100644 --- a/test/entt/core/compressed_pair.cpp +++ b/test/entt/core/compressed_pair.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "../common/non_default_constructible.h" struct empty_type {}; @@ -34,13 +35,6 @@ struct move_only_type { int *value; }; -struct non_default_constructible { - non_default_constructible(int v) - : value{v} {} - - int value; -}; - TEST(CompressedPair, Size) { struct local { int value; @@ -55,18 +49,18 @@ TEST(CompressedPair, Size) { } TEST(CompressedPair, ConstructCopyMove) { - ASSERT_FALSE((std::is_default_constructible_v>)); + ASSERT_FALSE((std::is_default_constructible_v>)); ASSERT_TRUE((std::is_default_constructible_v>)); - ASSERT_TRUE((std::is_copy_constructible_v>)); + ASSERT_TRUE((std::is_copy_constructible_v>)); ASSERT_FALSE((std::is_copy_constructible_v>)); - ASSERT_TRUE((std::is_copy_assignable_v>)); + ASSERT_TRUE((std::is_copy_assignable_v>)); ASSERT_FALSE((std::is_copy_assignable_v>)); ASSERT_TRUE((std::is_move_constructible_v>)); ASSERT_TRUE((std::is_move_assignable_v>)); - entt::compressed_pair copyable{non_default_constructible{42}, empty_type{}}; + entt::compressed_pair copyable{test::non_default_constructible{42}, empty_type{}}; auto by_copy{copyable}; ASSERT_EQ(by_copy.first().value, 42);