mirror of
https://github.com/SFML/SFML.git
synced 2025-01-18 15:25:12 +08:00
Add tests for sf::Mouse
This commit is contained in:
parent
b56604c940
commit
0caa5ed703
@ -83,6 +83,7 @@ set(WINDOW_SRC
|
|||||||
Window/GlResource.test.cpp
|
Window/GlResource.test.cpp
|
||||||
Window/Joystick.test.cpp
|
Window/Joystick.test.cpp
|
||||||
Window/Keyboard.test.cpp
|
Window/Keyboard.test.cpp
|
||||||
|
Window/Mouse.test.cpp
|
||||||
Window/VideoMode.test.cpp
|
Window/VideoMode.test.cpp
|
||||||
Window/Vulkan.test.cpp
|
Window/Vulkan.test.cpp
|
||||||
Window/Window.test.cpp
|
Window/Window.test.cpp
|
||||||
|
17
test/Window/Mouse.test.cpp
Normal file
17
test/Window/Mouse.test.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include <SFML/Window/Mouse.hpp>
|
||||||
|
|
||||||
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
|
||||||
|
#include <WindowUtil.hpp>
|
||||||
|
|
||||||
|
TEST_CASE("[Window] sf::Mouse", runDisplayTests())
|
||||||
|
{
|
||||||
|
SECTION("isButtonPressed()")
|
||||||
|
{
|
||||||
|
CHECK(!sf::Mouse::isButtonPressed(sf::Mouse::Button::Left));
|
||||||
|
CHECK(!sf::Mouse::isButtonPressed(sf::Mouse::Button::Right));
|
||||||
|
CHECK(!sf::Mouse::isButtonPressed(sf::Mouse::Button::Middle));
|
||||||
|
CHECK(!sf::Mouse::isButtonPressed(sf::Mouse::Button::Extra1));
|
||||||
|
CHECK(!sf::Mouse::isButtonPressed(sf::Mouse::Button::Extra2));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user