Add tests for sf::Event

This commit is contained in:
Chris Thrasher 2023-08-22 23:39:44 -06:00
parent 71615c8268
commit 05b69119e4
2 changed files with 23 additions and 0 deletions

View File

@ -62,6 +62,7 @@ set(WINDOW_SRC
Window/Context.test.cpp Window/Context.test.cpp
Window/ContextSettings.test.cpp Window/ContextSettings.test.cpp
Window/Cursor.test.cpp Window/Cursor.test.cpp
Window/Event.test.cpp
Window/GlResource.test.cpp Window/GlResource.test.cpp
Window/VideoMode.test.cpp Window/VideoMode.test.cpp
Window/Window.test.cpp Window/Window.test.cpp

View File

@ -0,0 +1,22 @@
#include <SFML/Window/Event.hpp>
#include <catch2/catch_test_macros.hpp>
#include <type_traits>
TEST_CASE("[Window] sf::Event")
{
SECTION("Type traits")
{
STATIC_CHECK(std::is_copy_constructible_v<sf::Event>);
STATIC_CHECK(std::is_copy_assignable_v<sf::Event>);
STATIC_CHECK(std::is_nothrow_move_constructible_v<sf::Event>);
STATIC_CHECK(std::is_nothrow_move_assignable_v<sf::Event>);
}
SECTION("Construction")
{
const sf::Event event{};
CHECK(event.type == sf::Event::Closed);
}
}