mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
Add more tests for the Window module
This commit is contained in:
1 parent
02d6d4937a
commit
d971aada83
6 files changed
+114
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
#include <CSFML/Window/Joystick.h>
|
||||
|
||||
#include <SFML/Window/Joystick.hpp>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators_range.hpp>
|
||||
|
||||
@@ -12,6 +14,18 @@ TEST_CASE("[Window] sfJoystick")
|
||||
STATIC_CHECK(sfJoystickAxisCount == 8);
|
||||
}
|
||||
|
||||
SECTION("sfJoystickAxis")
|
||||
{
|
||||
STATIC_CHECK(sfJoystickX == static_cast<int>(sf::Joystick::Axis::X));
|
||||
STATIC_CHECK(sfJoystickY == static_cast<int>(sf::Joystick::Axis::Y));
|
||||
STATIC_CHECK(sfJoystickZ == static_cast<int>(sf::Joystick::Axis::Z));
|
||||
STATIC_CHECK(sfJoystickR == static_cast<int>(sf::Joystick::Axis::R));
|
||||
STATIC_CHECK(sfJoystickU == static_cast<int>(sf::Joystick::Axis::U));
|
||||
STATIC_CHECK(sfJoystickV == static_cast<int>(sf::Joystick::Axis::V));
|
||||
STATIC_CHECK(sfJoystickPovX == static_cast<int>(sf::Joystick::Axis::PovX));
|
||||
STATIC_CHECK(sfJoystickPovY == static_cast<int>(sf::Joystick::Axis::PovY));
|
||||
}
|
||||
|
||||
// By avoiding calling sfJoystick_update() we can guarantee that
|
||||
// no joysticks will be detected. This is how we can ensure these
|
||||
// tests are portable and reliable.
|
||||
|
||||
Reference in new issue
Block a user