Files
CSFML/test/Window/Keyboard.test.cpp
T
ZXShady 884dcde3c3 Make enumeration counts constant expressions
This change allows now having these variables as array sizes that
are not Variable Length Arrays like in structs for example.

To note however that this changes the type from unsigned int to an
implementation defined type which usually `int` which is signed and
not unsigned.
2024-10-04 09:05:55 -06:00

30 lines
1.2 KiB
C++

#include <CSFML/Window/Keyboard.h>
#include <SFML/Window/Keyboard.hpp>
#include <catch2/catch_test_macros.hpp>
TEST_CASE("[Window] sfKeyboard")
{
SECTION("sfKeyCode")
{
STATIC_CHECK(sfKeyUnknown == static_cast<int>(sf::Keyboard::Key::Unknown));
STATIC_CHECK(sfKeyA == static_cast<int>(sf::Keyboard::Key::A));
STATIC_CHECK(sfKeyB == static_cast<int>(sf::Keyboard::Key::B));
STATIC_CHECK(sfKeyC == static_cast<int>(sf::Keyboard::Key::C));
STATIC_CHECK(sfKeyD == static_cast<int>(sf::Keyboard::Key::D));
STATIC_CHECK(sfKeyPause == static_cast<int>(sf::Keyboard::Key::Pause));
STATIC_CHECK(sfKeyCount == sf::Keyboard::KeyCount);
}
SECTION("sfScancode")
{
STATIC_CHECK(sfScanUnknown == static_cast<int>(sf::Keyboard::Scan::Unknown));
STATIC_CHECK(sfScanA == static_cast<int>(sf::Keyboard::Scan::A));
STATIC_CHECK(sfScanB == static_cast<int>(sf::Keyboard::Scan::B));
STATIC_CHECK(sfScanC == static_cast<int>(sf::Keyboard::Scan::C));
STATIC_CHECK(sfScanD == static_cast<int>(sf::Keyboard::Scan::D));
STATIC_CHECK(sfScancodeCount == sf::Keyboard::ScancodeCount);
}
}