mirror of
https://github.com/SFML/SFML.git
synced 2025-02-22 22:36:02 +08:00
Add tests for sf::Mouse
This commit is contained in:
parent
601b5032e7
commit
78907dea9e
@ -82,6 +82,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…
x
Reference in New Issue
Block a user