mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Add tests for sf::Event
This commit is contained in:
parent
71615c8268
commit
05b69119e4
@ -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
|
||||
|
22
test/Window/Event.test.cpp
Normal file
22
test/Window/Event.test.cpp
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user