From 9feef3708d98d09bfb027a8eb1d21ab8a732af20 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 25 Jul 2022 00:36:05 -0600 Subject: [PATCH] Test existence of copy and move semantics --- test/Audio/AlResource.cpp | 9 ++++++++ test/Audio/Dummy.cpp | 0 test/Audio/InputSoundFile.cpp | 8 +++++++ test/Audio/Music.cpp | 8 +++++++ test/Audio/OutputSoundFile.cpp | 8 +++++++ test/Audio/Sound.cpp | 10 +++++++++ test/Audio/SoundBuffer.cpp | 10 +++++++++ test/Audio/SoundBufferRecorder.cpp | 8 +++++++ test/Audio/SoundRecorder.cpp | 9 ++++++++ test/Audio/SoundSource.cpp | 10 +++++++++ test/Audio/SoundStream.cpp | 9 ++++++++ test/CMakeLists.txt | 36 ++++++++++++++++++++++++++++-- test/Graphics/BlendMode.cpp | 6 +++++ test/Graphics/CircleShape.cpp | 6 +++++ test/Graphics/Color.cpp | 6 +++++ test/Graphics/ConvexShape.cpp | 6 +++++ test/Graphics/Drawable.cpp | 9 ++++++++ test/Graphics/Font.cpp | 8 +++++++ test/Graphics/Glyph.cpp | 6 +++++ test/Graphics/Image.cpp | 6 +++++ test/Graphics/Rect.cpp | 6 +++++ test/Graphics/RectangleShape.cpp | 6 +++++ test/Graphics/RenderStates.cpp | 6 +++++ test/Graphics/RenderTarget.cpp | 9 ++++++++ test/Graphics/RenderTexture.cpp | 8 +++++++ test/Graphics/RenderWindow.cpp | 8 +++++++ test/Graphics/Shader.cpp | 8 +++++++ test/Graphics/Shape.cpp | 7 ++++++ test/Graphics/Sprite.cpp | 8 +++++++ test/Graphics/Text.cpp | 8 +++++++ test/Graphics/Texture.cpp | 10 +++++++++ test/Graphics/Transform.cpp | 6 +++++ test/Graphics/Transformable.cpp | 6 +++++ test/Graphics/Vertex.cpp | 6 +++++ test/Graphics/VertexArray.cpp | 6 +++++ test/Graphics/VertexBuffer.cpp | 10 +++++++++ test/Graphics/View.cpp | 6 +++++ test/Network/Ftp.cpp | 8 +++++++ test/Network/Http.cpp | 8 +++++++ test/Network/IpAddress.cpp | 6 +++++ test/Network/Packet.cpp | 6 +++++ test/Network/Socket.cpp | 9 ++++++++ test/Network/SocketSelector.cpp | 10 +++++++++ test/Network/TcpListener.cpp | 8 +++++++ test/Network/TcpSocket.cpp | 8 +++++++ test/Network/UdpSocket.cpp | 8 +++++++ test/System/Angle.cpp | 6 +++++ test/System/Clock.cpp | 6 +++++ test/System/String.cpp | 8 +++++++ test/System/Time.cpp | 6 +++++ test/System/Vector2.cpp | 4 ++++ test/System/Vector3.cpp | 5 +++++ test/Window/Context.cpp | 8 +++++++ test/Window/ContextSettings.cpp | 7 ++++++ test/Window/Cursor.cpp | 8 +++++++ test/Window/GlResource.cpp | 9 ++++++++ test/Window/VideoMode.cpp | 6 +++++ test/Window/Window.cpp | 8 +++++++ test/Window/WindowBase.cpp | 8 +++++++ 59 files changed, 460 insertions(+), 2 deletions(-) create mode 100644 test/Audio/AlResource.cpp delete mode 100644 test/Audio/Dummy.cpp create mode 100644 test/Audio/InputSoundFile.cpp create mode 100644 test/Audio/Music.cpp create mode 100644 test/Audio/OutputSoundFile.cpp create mode 100644 test/Audio/Sound.cpp create mode 100644 test/Audio/SoundBuffer.cpp create mode 100644 test/Audio/SoundBufferRecorder.cpp create mode 100644 test/Audio/SoundRecorder.cpp create mode 100644 test/Audio/SoundSource.cpp create mode 100644 test/Audio/SoundStream.cpp create mode 100644 test/Graphics/Drawable.cpp create mode 100644 test/Graphics/Font.cpp create mode 100644 test/Graphics/RenderTarget.cpp create mode 100644 test/Graphics/RenderTexture.cpp create mode 100644 test/Graphics/RenderWindow.cpp create mode 100644 test/Graphics/Shader.cpp create mode 100644 test/Graphics/Sprite.cpp create mode 100644 test/Graphics/Text.cpp create mode 100644 test/Graphics/Texture.cpp create mode 100644 test/Graphics/VertexBuffer.cpp create mode 100644 test/Network/Ftp.cpp create mode 100644 test/Network/Http.cpp create mode 100644 test/Network/Socket.cpp create mode 100644 test/Network/SocketSelector.cpp create mode 100644 test/Network/TcpListener.cpp create mode 100644 test/Network/TcpSocket.cpp create mode 100644 test/Network/UdpSocket.cpp create mode 100644 test/System/String.cpp create mode 100644 test/Window/Context.cpp create mode 100644 test/Window/Cursor.cpp create mode 100644 test/Window/GlResource.cpp create mode 100644 test/Window/Window.cpp create mode 100644 test/Window/WindowBase.cpp diff --git a/test/Audio/AlResource.cpp b/test/Audio/AlResource.cpp new file mode 100644 index 000000000..819de7c3a --- /dev/null +++ b/test/Audio/AlResource.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Audio/Dummy.cpp b/test/Audio/Dummy.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/Audio/InputSoundFile.cpp b/test/Audio/InputSoundFile.cpp new file mode 100644 index 000000000..28a2758a6 --- /dev/null +++ b/test/Audio/InputSoundFile.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/Music.cpp b/test/Audio/Music.cpp new file mode 100644 index 000000000..150771a1f --- /dev/null +++ b/test/Audio/Music.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/OutputSoundFile.cpp b/test/Audio/OutputSoundFile.cpp new file mode 100644 index 000000000..a2a259e13 --- /dev/null +++ b/test/Audio/OutputSoundFile.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/Sound.cpp b/test/Audio/Sound.cpp new file mode 100644 index 000000000..727f34021 --- /dev/null +++ b/test/Audio/Sound.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/SoundBuffer.cpp b/test/Audio/SoundBuffer.cpp new file mode 100644 index 000000000..c62ea06db --- /dev/null +++ b/test/Audio/SoundBuffer.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/SoundBufferRecorder.cpp b/test/Audio/SoundBufferRecorder.cpp new file mode 100644 index 000000000..8f1c41db2 --- /dev/null +++ b/test/Audio/SoundBufferRecorder.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/SoundRecorder.cpp b/test/Audio/SoundRecorder.cpp new file mode 100644 index 000000000..571e0ab68 --- /dev/null +++ b/test/Audio/SoundRecorder.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/SoundSource.cpp b/test/Audio/SoundSource.cpp new file mode 100644 index 000000000..4804e6781 --- /dev/null +++ b/test/Audio/SoundSource.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(!std::is_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Audio/SoundStream.cpp b/test/Audio/SoundStream.cpp new file mode 100644 index 000000000..4438ccb0d --- /dev/null +++ b/test/Audio/SoundStream.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9b07ba727..03e4f98db 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,6 +30,7 @@ set(SYSTEM_SRC System/Err.cpp System/FileInputStream.cpp System/MemoryInputStream.cpp + System/String.cpp System/Time.cpp System/Vector2.cpp System/Vector3.cpp @@ -43,8 +44,13 @@ target_compile_definitions(test-sfml-system PRIVATE ) set(WINDOW_SRC + Window/Context.cpp Window/ContextSettings.cpp + Window/Cursor.cpp + Window/GlResource.cpp Window/VideoMode.cpp + Window/Window.cpp + Window/WindowBase.cpp ) sfml_add_test(test-sfml-window "${WINDOW_SRC}" SFML::Window) @@ -53,28 +59,54 @@ set(GRAPHICS_SRC Graphics/CircleShape.cpp Graphics/Color.cpp Graphics/ConvexShape.cpp + Graphics/Drawable.cpp + Graphics/Font.cpp Graphics/Glyph.cpp Graphics/Image.cpp Graphics/Rect.cpp Graphics/RectangleShape.cpp - Graphics/Shape.cpp Graphics/RenderStates.cpp + Graphics/RenderTarget.cpp + Graphics/RenderTexture.cpp + Graphics/RenderWindow.cpp + Graphics/Shader.cpp + Graphics/Shape.cpp + Graphics/Sprite.cpp + Graphics/Text.cpp + Graphics/Texture.cpp Graphics/Transform.cpp Graphics/Transformable.cpp Graphics/Vertex.cpp Graphics/VertexArray.cpp + Graphics/VertexBuffer.cpp Graphics/View.cpp ) sfml_add_test(test-sfml-graphics "${GRAPHICS_SRC}" SFML::Graphics) set(NETWORK_SRC + Network/Ftp.cpp + Network/Http.cpp Network/IpAddress.cpp Network/Packet.cpp + Network/Socket.cpp + Network/SocketSelector.cpp + Network/TcpListener.cpp + Network/TcpSocket.cpp + Network/UdpSocket.cpp ) sfml_add_test(test-sfml-network "${NETWORK_SRC}" SFML::Network) set(AUDIO_SRC - Audio/Dummy.cpp # TODO: Remove when there are real tests + Audio/AlResource.cpp + Audio/InputSoundFile.cpp + Audio/Music.cpp + Audio/OutputSoundFile.cpp + Audio/Sound.cpp + Audio/SoundBuffer.cpp + Audio/SoundBufferRecorder.cpp + Audio/SoundRecorder.cpp + Audio/SoundSource.cpp + Audio/SoundStream.cpp ) sfml_add_test(test-sfml-audio "${AUDIO_SRC}" SFML::Audio) diff --git a/test/Graphics/BlendMode.cpp b/test/Graphics/BlendMode.cpp index 378d4ab32..b187b005b 100644 --- a/test/Graphics/BlendMode.cpp +++ b/test/Graphics/BlendMode.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::BlendMode") { diff --git a/test/Graphics/CircleShape.cpp b/test/Graphics/CircleShape.cpp index c5dcf7a23..3f766126f 100644 --- a/test/Graphics/CircleShape.cpp +++ b/test/Graphics/CircleShape.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(std::is_move_assignable_v); TEST_CASE("[Graphics] sf::CircleShape") { diff --git a/test/Graphics/Color.cpp b/test/Graphics/Color.cpp index f7b77a2cc..0ed31eb3c 100644 --- a/test/Graphics/Color.cpp +++ b/test/Graphics/Color.cpp @@ -3,8 +3,14 @@ #include #include +#include #include +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + TEST_CASE("[Graphics] sf::Color") { SUBCASE("Construction") diff --git a/test/Graphics/ConvexShape.cpp b/test/Graphics/ConvexShape.cpp index 449214a19..04e7cbb9c 100644 --- a/test/Graphics/ConvexShape.cpp +++ b/test/Graphics/ConvexShape.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(std::is_move_assignable_v); TEST_CASE("[Graphics] sf::ConvexShape") { diff --git a/test/Graphics/Drawable.cpp b/test/Graphics/Drawable.cpp new file mode 100644 index 000000000..961acc8c3 --- /dev/null +++ b/test/Graphics/Drawable.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Font.cpp b/test/Graphics/Font.cpp new file mode 100644 index 000000000..6cbf1fcd7 --- /dev/null +++ b/test/Graphics/Font.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Glyph.cpp b/test/Graphics/Glyph.cpp index 0885c750e..cf59c5757 100644 --- a/test/Graphics/Glyph.cpp +++ b/test/Graphics/Glyph.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::Glyph") { diff --git a/test/Graphics/Image.cpp b/test/Graphics/Image.cpp index 3f9b5aa25..107959ebd 100644 --- a/test/Graphics/Image.cpp +++ b/test/Graphics/Image.cpp @@ -4,6 +4,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::Image") { diff --git a/test/Graphics/Rect.cpp b/test/Graphics/Rect.cpp index 78a0208da..5daeb529f 100644 --- a/test/Graphics/Rect.cpp +++ b/test/Graphics/Rect.cpp @@ -4,6 +4,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::Rect") { diff --git a/test/Graphics/RectangleShape.cpp b/test/Graphics/RectangleShape.cpp index cb672c120..0a49d23a4 100644 --- a/test/Graphics/RectangleShape.cpp +++ b/test/Graphics/RectangleShape.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(std::is_move_assignable_v); TEST_CASE("[Graphics] sf::RectangleShape") { diff --git a/test/Graphics/RenderStates.cpp b/test/Graphics/RenderStates.cpp index dc4c5be9f..60d664258 100644 --- a/test/Graphics/RenderStates.cpp +++ b/test/Graphics/RenderStates.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::RenderStates") { diff --git a/test/Graphics/RenderTarget.cpp b/test/Graphics/RenderTarget.cpp new file mode 100644 index 000000000..bb7f13023 --- /dev/null +++ b/test/Graphics/RenderTarget.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/RenderTexture.cpp b/test/Graphics/RenderTexture.cpp new file mode 100644 index 000000000..4799e0588 --- /dev/null +++ b/test/Graphics/RenderTexture.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/RenderWindow.cpp b/test/Graphics/RenderWindow.cpp new file mode 100644 index 000000000..441c996cb --- /dev/null +++ b/test/Graphics/RenderWindow.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Shader.cpp b/test/Graphics/Shader.cpp new file mode 100644 index 000000000..4008895b4 --- /dev/null +++ b/test/Graphics/Shader.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Shape.cpp b/test/Graphics/Shape.cpp index 49a06476d..411426280 100644 --- a/test/Graphics/Shape.cpp +++ b/test/Graphics/Shape.cpp @@ -3,6 +3,13 @@ #include #include +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(!std::is_move_constructible_v); +static_assert(std::is_move_assignable_v); class TriangleShape : public sf::Shape { diff --git a/test/Graphics/Sprite.cpp b/test/Graphics/Sprite.cpp new file mode 100644 index 000000000..3f74ed004 --- /dev/null +++ b/test/Graphics/Sprite.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Text.cpp b/test/Graphics/Text.cpp new file mode 100644 index 000000000..9cf101974 --- /dev/null +++ b/test/Graphics/Text.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Texture.cpp b/test/Graphics/Texture.cpp new file mode 100644 index 000000000..c48fbcd42 --- /dev/null +++ b/test/Graphics/Texture.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/Transform.cpp b/test/Graphics/Transform.cpp index 30d778a14..e38f15765 100644 --- a/test/Graphics/Transform.cpp +++ b/test/Graphics/Transform.cpp @@ -5,8 +5,14 @@ #include #include +#include #include +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + // Use StringMaker to avoid opening namespace std namespace doctest { diff --git a/test/Graphics/Transformable.cpp b/test/Graphics/Transformable.cpp index 5f7bb0d6a..c2b727a09 100644 --- a/test/Graphics/Transformable.cpp +++ b/test/Graphics/Transformable.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::Transformable") { diff --git a/test/Graphics/Vertex.cpp b/test/Graphics/Vertex.cpp index 20207c7fd..5b7695a45 100644 --- a/test/Graphics/Vertex.cpp +++ b/test/Graphics/Vertex.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::Vertex") { diff --git a/test/Graphics/VertexArray.cpp b/test/Graphics/VertexArray.cpp index 31014b10f..320a164f0 100644 --- a/test/Graphics/VertexArray.cpp +++ b/test/Graphics/VertexArray.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::VertexArray") { diff --git a/test/Graphics/VertexBuffer.cpp b/test/Graphics/VertexBuffer.cpp new file mode 100644 index 000000000..145d15a86 --- /dev/null +++ b/test/Graphics/VertexBuffer.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Graphics/View.cpp b/test/Graphics/View.cpp index e996d2aa9..e1411e6cf 100644 --- a/test/Graphics/View.cpp +++ b/test/Graphics/View.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Graphics] sf::View") { diff --git a/test/Network/Ftp.cpp b/test/Network/Ftp.cpp new file mode 100644 index 000000000..a74396ce9 --- /dev/null +++ b/test/Network/Ftp.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/Http.cpp b/test/Network/Http.cpp new file mode 100644 index 000000000..71e8cc65e --- /dev/null +++ b/test/Network/Http.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/IpAddress.cpp b/test/Network/IpAddress.cpp index 028190cdc..6bff52d39 100644 --- a/test/Network/IpAddress.cpp +++ b/test/Network/IpAddress.cpp @@ -4,10 +4,16 @@ #include #include +#include using namespace std::string_literals; using namespace std::string_view_literals; +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + TEST_CASE("[Network] sf::IpAddress") { SUBCASE("Construction") diff --git a/test/Network/Packet.cpp b/test/Network/Packet.cpp index a6a569ace..4f603cdd1 100644 --- a/test/Network/Packet.cpp +++ b/test/Network/Packet.cpp @@ -4,6 +4,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); #define CHECK_PACKET_STREAM_OPERATORS(expected) \ do \ diff --git a/test/Network/Socket.cpp b/test/Network/Socket.cpp new file mode 100644 index 000000000..7493a55ef --- /dev/null +++ b/test/Network/Socket.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/SocketSelector.cpp b/test/Network/SocketSelector.cpp new file mode 100644 index 000000000..0a7eee6c1 --- /dev/null +++ b/test/Network/SocketSelector.cpp @@ -0,0 +1,10 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_move_constructible_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_move_assignable_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/TcpListener.cpp b/test/Network/TcpListener.cpp new file mode 100644 index 000000000..bcb242d37 --- /dev/null +++ b/test/Network/TcpListener.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/TcpSocket.cpp b/test/Network/TcpSocket.cpp new file mode 100644 index 000000000..aeee20ba8 --- /dev/null +++ b/test/Network/TcpSocket.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Network/UdpSocket.cpp b/test/Network/UdpSocket.cpp new file mode 100644 index 000000000..f1016ec38 --- /dev/null +++ b/test/Network/UdpSocket.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/System/Angle.cpp b/test/System/Angle.cpp index 4db2f2e6d..e838346c4 100644 --- a/test/System/Angle.cpp +++ b/test/System/Angle.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[System] sf::Angle") { diff --git a/test/System/Clock.cpp b/test/System/Clock.cpp index 114253e7a..72e2d764e 100644 --- a/test/System/Clock.cpp +++ b/test/System/Clock.cpp @@ -5,6 +5,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[System] sf::Clock") { diff --git a/test/System/String.cpp b/test/System/String.cpp new file mode 100644 index 000000000..a6d3c01fd --- /dev/null +++ b/test/System/String.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/System/Time.cpp b/test/System/Time.cpp index 38eba4638..ca9e99c1b 100644 --- a/test/System/Time.cpp +++ b/test/System/Time.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); using namespace std::chrono_literals; diff --git a/test/System/Vector2.cpp b/test/System/Vector2.cpp index 0dc32cd42..489a02e7f 100644 --- a/test/System/Vector2.cpp +++ b/test/System/Vector2.cpp @@ -11,6 +11,10 @@ using namespace sf::Literals; // Use sf::Vector2i for tests (except for float vector algebra). // Test coverage is given, as there are no template specializations. +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[System] sf::Vector2") { diff --git a/test/System/Vector3.cpp b/test/System/Vector3.cpp index 92cb977a4..119db5748 100644 --- a/test/System/Vector3.cpp +++ b/test/System/Vector3.cpp @@ -8,6 +8,11 @@ // Use sf::Vector3i for tests (except for float vector algebra). // Test coverage is given, as there are no template specializations. +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + TEST_CASE("[System] sf::Vector3") { SUBCASE("Construction") diff --git a/test/Window/Context.cpp b/test/Window/Context.cpp new file mode 100644 index 000000000..57f5bee56 --- /dev/null +++ b/test/Window/Context.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Window/ContextSettings.cpp b/test/Window/ContextSettings.cpp index 23cb06da5..942276909 100644 --- a/test/Window/ContextSettings.cpp +++ b/test/Window/ContextSettings.cpp @@ -2,6 +2,13 @@ #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + TEST_CASE("[Window] sf::ContextSettings") { SUBCASE("Construction") diff --git a/test/Window/Cursor.cpp b/test/Window/Cursor.cpp new file mode 100644 index 000000000..ca93af0be --- /dev/null +++ b/test/Window/Cursor.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Window/GlResource.cpp b/test/Window/GlResource.cpp new file mode 100644 index 000000000..d0a0872da --- /dev/null +++ b/test/Window/GlResource.cpp @@ -0,0 +1,9 @@ +#include + +#include + +static_assert(!std::is_constructible_v); +static_assert(!std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); diff --git a/test/Window/VideoMode.cpp b/test/Window/VideoMode.cpp index afe8e119e..866719d05 100644 --- a/test/Window/VideoMode.cpp +++ b/test/Window/VideoMode.cpp @@ -3,6 +3,12 @@ #include #include +#include + +static_assert(std::is_copy_constructible_v); +static_assert(std::is_copy_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); TEST_CASE("[Window] sf::VideoMode") { diff --git a/test/Window/Window.cpp b/test/Window/Window.cpp new file mode 100644 index 000000000..e778c5694 --- /dev/null +++ b/test/Window/Window.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v); diff --git a/test/Window/WindowBase.cpp b/test/Window/WindowBase.cpp new file mode 100644 index 000000000..63032aa40 --- /dev/null +++ b/test/Window/WindowBase.cpp @@ -0,0 +1,8 @@ +#include + +#include + +static_assert(!std::is_copy_constructible_v); +static_assert(!std::is_copy_assignable_v); +static_assert(!std::is_nothrow_move_constructible_v); +static_assert(!std::is_nothrow_move_assignable_v);