From 2b261e844c1b4eaf88ec9c24dabad4b1e6ba8bfe 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 | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/Window/Mouse.test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 563d6d6c2..1351e1863 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -80,6 +80,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..7f53085c2 --- /dev/null +++ b/test/Window/Mouse.test.cpp @@ -0,0 +1,15 @@ +#include + +#include + +TEST_CASE("[Window] sf::Mouse") +{ + 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)); + } +}