From 922286023385e07558028eedec591ecb13755709 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 12 Dec 2024 22:40:57 -0700 Subject: [PATCH] Harden copyability tests to test for triviality --- test/Audio/SoundFileFactory.test.cpp | 4 +-- test/Graphics/BlendMode.test.cpp | 4 +-- test/Graphics/Color.test.cpp | 4 +-- test/Graphics/CoordinateType.test.cpp | 4 +-- test/Graphics/Glsl.test.cpp | 44 +++++++++++++-------------- test/Graphics/Glyph.test.cpp | 4 +-- test/Graphics/Rect.test.cpp | 4 +-- test/Graphics/RenderStates.test.cpp | 4 +-- test/Graphics/StencilMode.test.cpp | 4 +-- test/Graphics/Transform.test.cpp | 4 +-- test/Graphics/Vertex.test.cpp | 4 +-- test/Graphics/View.test.cpp | 4 +-- test/Network/IpAddress.test.cpp | 4 +-- test/System/Angle.test.cpp | 4 +-- test/System/Clock.test.cpp | 4 +-- test/System/String.test.cpp | 4 +-- test/System/Time.test.cpp | 4 +-- test/System/Vector2.test.cpp | 4 +-- test/System/Vector3.test.cpp | 4 +-- test/Window/ContextSettings.test.cpp | 4 +-- test/Window/Event.test.cpp | 4 +-- test/Window/VideoMode.test.cpp | 4 +-- 22 files changed, 64 insertions(+), 64 deletions(-) diff --git a/test/Audio/SoundFileFactory.test.cpp b/test/Audio/SoundFileFactory.test.cpp index 5d797657c..2f018dea1 100644 --- a/test/Audio/SoundFileFactory.test.cpp +++ b/test/Audio/SoundFileFactory.test.cpp @@ -63,8 +63,8 @@ TEST_CASE("[Audio] sf::SoundFileFactory") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/BlendMode.test.cpp b/test/Graphics/BlendMode.test.cpp index 19701b6ab..29f41f3b7 100644 --- a/test/Graphics/BlendMode.test.cpp +++ b/test/Graphics/BlendMode.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[Graphics] sf::BlendMode") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Color.test.cpp b/test/Graphics/Color.test.cpp index cce58a534..dea77b9ca 100644 --- a/test/Graphics/Color.test.cpp +++ b/test/Graphics/Color.test.cpp @@ -10,8 +10,8 @@ TEST_CASE("[Graphics] sf::Color") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); STATIC_CHECK(std::is_trivially_copyable_v); diff --git a/test/Graphics/CoordinateType.test.cpp b/test/Graphics/CoordinateType.test.cpp index b3e69cccd..0b86ea9d2 100644 --- a/test/Graphics/CoordinateType.test.cpp +++ b/test/Graphics/CoordinateType.test.cpp @@ -8,8 +8,8 @@ TEST_CASE("[Graphics] sf::CoordinateType") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Glsl.test.cpp b/test/Graphics/Glsl.test.cpp index 68c685ac8..b77104377 100644 --- a/test/Graphics/Glsl.test.cpp +++ b/test/Graphics/Glsl.test.cpp @@ -16,8 +16,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -31,8 +31,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -46,8 +46,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -61,8 +61,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -77,8 +77,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -93,8 +93,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -109,8 +109,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -159,8 +159,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -209,8 +209,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -250,8 +250,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } @@ -291,8 +291,8 @@ TEST_CASE("[Graphics] sf::Glsl") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Glyph.test.cpp b/test/Graphics/Glyph.test.cpp index 9d707a4b4..5bf5364b5 100644 --- a/test/Graphics/Glyph.test.cpp +++ b/test/Graphics/Glyph.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[Graphics] sf::Glyph") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Rect.test.cpp b/test/Graphics/Rect.test.cpp index edb94a710..594caf56c 100644 --- a/test/Graphics/Rect.test.cpp +++ b/test/Graphics/Rect.test.cpp @@ -11,8 +11,8 @@ TEMPLATE_TEST_CASE("[Graphics] sf::Rect", "", int, float) { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v>); - STATIC_CHECK(std::is_copy_assignable_v>); + STATIC_CHECK(std::is_trivially_copy_constructible_v>); + STATIC_CHECK(std::is_trivially_copy_assignable_v>); STATIC_CHECK(std::is_nothrow_move_constructible_v>); STATIC_CHECK(std::is_nothrow_move_assignable_v>); } diff --git a/test/Graphics/RenderStates.test.cpp b/test/Graphics/RenderStates.test.cpp index de9c3be62..f56ec9a4d 100644 --- a/test/Graphics/RenderStates.test.cpp +++ b/test/Graphics/RenderStates.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[Graphics] sf::RenderStates") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/StencilMode.test.cpp b/test/Graphics/StencilMode.test.cpp index 9086b6987..108fa89b8 100644 --- a/test/Graphics/StencilMode.test.cpp +++ b/test/Graphics/StencilMode.test.cpp @@ -8,8 +8,8 @@ TEST_CASE("[Graphics] sf::StencilMode") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Transform.test.cpp b/test/Graphics/Transform.test.cpp index 08600c3a3..3f0e1462f 100644 --- a/test/Graphics/Transform.test.cpp +++ b/test/Graphics/Transform.test.cpp @@ -15,8 +15,8 @@ TEST_CASE("[Graphics] sf::Transform") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Graphics/Vertex.test.cpp b/test/Graphics/Vertex.test.cpp index 0fca658f5..fd636709b 100644 --- a/test/Graphics/Vertex.test.cpp +++ b/test/Graphics/Vertex.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[Graphics] sf::Vertex") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); STATIC_CHECK(std::is_aggregate_v); diff --git a/test/Graphics/View.test.cpp b/test/Graphics/View.test.cpp index b81935b5a..18540c674 100644 --- a/test/Graphics/View.test.cpp +++ b/test/Graphics/View.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[Graphics] sf::View") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Network/IpAddress.test.cpp b/test/Network/IpAddress.test.cpp index d62b72b75..dc175d4aa 100644 --- a/test/Network/IpAddress.test.cpp +++ b/test/Network/IpAddress.test.cpp @@ -13,8 +13,8 @@ TEST_CASE("[Network] sf::IpAddress") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); STATIC_CHECK(std::is_trivially_copyable_v); diff --git a/test/System/Angle.test.cpp b/test/System/Angle.test.cpp index 68990645a..4ef0acd8a 100644 --- a/test/System/Angle.test.cpp +++ b/test/System/Angle.test.cpp @@ -9,8 +9,8 @@ TEST_CASE("[System] sf::Angle") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); STATIC_CHECK(std::is_trivially_copyable_v); diff --git a/test/System/Clock.test.cpp b/test/System/Clock.test.cpp index 4eb0ba2dc..6179fe587 100644 --- a/test/System/Clock.test.cpp +++ b/test/System/Clock.test.cpp @@ -13,8 +13,8 @@ TEST_CASE("[System] sf::Clock") SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/System/String.test.cpp b/test/System/String.test.cpp index e505b79dd..33b41333a 100644 --- a/test/System/String.test.cpp +++ b/test/System/String.test.cpp @@ -61,8 +61,8 @@ TEST_CASE("[System] sf::U8StringCharTraits") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/System/Time.test.cpp b/test/System/Time.test.cpp index 19a791dea..471e1db07 100644 --- a/test/System/Time.test.cpp +++ b/test/System/Time.test.cpp @@ -11,8 +11,8 @@ TEST_CASE("[System] sf::Time") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); STATIC_CHECK(std::is_trivially_copyable_v); diff --git a/test/System/Vector2.test.cpp b/test/System/Vector2.test.cpp index 8a0a047f0..4b943ab68 100644 --- a/test/System/Vector2.test.cpp +++ b/test/System/Vector2.test.cpp @@ -13,8 +13,8 @@ TEMPLATE_TEST_CASE("[System] sf::Vector2", "", int, float) { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v>); - STATIC_CHECK(std::is_copy_assignable_v>); + STATIC_CHECK(std::is_trivially_copy_constructible_v>); + STATIC_CHECK(std::is_trivially_copy_assignable_v>); STATIC_CHECK(std::is_nothrow_move_constructible_v>); STATIC_CHECK(std::is_nothrow_move_assignable_v>); STATIC_CHECK(std::is_trivially_copyable_v>); diff --git a/test/System/Vector3.test.cpp b/test/System/Vector3.test.cpp index d641d3db6..a7d62d53e 100644 --- a/test/System/Vector3.test.cpp +++ b/test/System/Vector3.test.cpp @@ -9,8 +9,8 @@ TEMPLATE_TEST_CASE("[System] sf::Vector3", "", int, float) { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v>); - STATIC_CHECK(std::is_copy_assignable_v>); + STATIC_CHECK(std::is_trivially_copy_constructible_v>); + STATIC_CHECK(std::is_trivially_copy_assignable_v>); STATIC_CHECK(std::is_nothrow_move_constructible_v>); STATIC_CHECK(std::is_nothrow_move_assignable_v>); } diff --git a/test/Window/ContextSettings.test.cpp b/test/Window/ContextSettings.test.cpp index d11cb87c1..8a162b360 100644 --- a/test/Window/ContextSettings.test.cpp +++ b/test/Window/ContextSettings.test.cpp @@ -8,8 +8,8 @@ TEST_CASE("[Window] sf::ContextSettings") { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Window/Event.test.cpp b/test/Window/Event.test.cpp index 198c60c9d..63d2651ba 100644 --- a/test/Window/Event.test.cpp +++ b/test/Window/Event.test.cpp @@ -37,8 +37,8 @@ TEST_CASE("[Window] sf::Event") SECTION("Type traits") { STATIC_CHECK(!std::is_default_constructible_v); - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); } diff --git a/test/Window/VideoMode.test.cpp b/test/Window/VideoMode.test.cpp index 614c49ac4..3e92bd96b 100644 --- a/test/Window/VideoMode.test.cpp +++ b/test/Window/VideoMode.test.cpp @@ -10,8 +10,8 @@ TEST_CASE("[Window] sf::VideoMode", runDisplayTests()) { SECTION("Type traits") { - STATIC_CHECK(std::is_copy_constructible_v); - STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_trivially_copy_constructible_v); + STATIC_CHECK(std::is_trivially_copy_assignable_v); STATIC_CHECK(std::is_nothrow_move_constructible_v); STATIC_CHECK(std::is_nothrow_move_assignable_v); }