From 0caa5ed7032eb9aba916bc81a73ef732e2b4f372 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 18 Sep 2023 19:48:27 -0600 Subject: [PATCH] Add tests for `sf::Mouse` --- test/CMakeLists.txt | 1 + test/Window/Mouse.test.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/Window/Mouse.test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 613c9a679..3236b0367 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -83,6 +83,7 @@ set(WINDOW_SRC Window/GlResource.test.cpp Window/Joystick.test.cpp Window/Keyboard.test.cpp + Window/Mouse.test.cpp Window/VideoMode.test.cpp Window/Vulkan.test.cpp Window/Window.test.cpp diff --git a/test/Window/Mouse.test.cpp b/test/Window/Mouse.test.cpp new file mode 100644 index 000000000..6a661cddf --- /dev/null +++ b/test/Window/Mouse.test.cpp @@ -0,0 +1,17 @@ +#include + +#include + +#include + +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)); + } +}