From 05b69119e4fe2e19eabafee73772a65f6ca5bf0b Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 22 Aug 2023 23:39:44 -0600 Subject: [PATCH] Add tests for `sf::Event` --- test/CMakeLists.txt | 1 + test/Window/Event.test.cpp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/Window/Event.test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c9751e0b..0ac05c23 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -62,6 +62,7 @@ set(WINDOW_SRC Window/Context.test.cpp Window/ContextSettings.test.cpp Window/Cursor.test.cpp + Window/Event.test.cpp Window/GlResource.test.cpp Window/VideoMode.test.cpp Window/Window.test.cpp diff --git a/test/Window/Event.test.cpp b/test/Window/Event.test.cpp new file mode 100644 index 00000000..1fbf65a3 --- /dev/null +++ b/test/Window/Event.test.cpp @@ -0,0 +1,22 @@ +#include + +#include + +#include + +TEST_CASE("[Window] sf::Event") +{ + SECTION("Type traits") + { + STATIC_CHECK(std::is_copy_constructible_v); + STATIC_CHECK(std::is_copy_assignable_v); + STATIC_CHECK(std::is_nothrow_move_constructible_v); + STATIC_CHECK(std::is_nothrow_move_assignable_v); + } + + SECTION("Construction") + { + const sf::Event event{}; + CHECK(event.type == sf::Event::Closed); + } +}