diff --git a/test/Window/Keyboard.test.cpp b/test/Window/Keyboard.test.cpp index 812520e..72bb5a2 100644 --- a/test/Window/Keyboard.test.cpp +++ b/test/Window/Keyboard.test.cpp @@ -26,4 +26,47 @@ TEST_CASE("[Window] sfKeyboard") STATIC_CHECK(sfScanD == static_cast(sf::Keyboard::Scan::D)); STATIC_CHECK(sfScancodeCount == sf::Keyboard::ScancodeCount); } + + SECTION("sfKeyboard_isKeyPressed") + { + CHECK(!sfKeyboard_isKeyPressed(sfKeyW)); + CHECK(!sfKeyboard_isKeyPressed(sfKeyA)); + CHECK(!sfKeyboard_isKeyPressed(sfKeyS)); + CHECK(!sfKeyboard_isKeyPressed(sfKeyD)); + } + + SECTION("sfKeyboard_isScancodePressed") + { + CHECK(!sfKeyboard_isScancodePressed(sfScanW)); + CHECK(!sfKeyboard_isScancodePressed(sfScanA)); + CHECK(!sfKeyboard_isScancodePressed(sfScanS)); + CHECK(!sfKeyboard_isScancodePressed(sfScanD)); + } + + SECTION("sfKeyboard_localize") + { + CHECK(sfKeyboard_localize(sfScanSpace) == sfKeySpace); + } + + SECTION("sfKeyboard_delocalize") + { + CHECK(sfKeyboard_delocalize(sfKeySpace) == sfScanSpace); + } + + SECTION("sfKeyboard_getDescription") + { + using namespace std::string_literals; + CHECK(sfKeyboard_getDescription(sfScanF1) == "F1"s); + CHECK(sfKeyboard_getDescription(sfScanF2) == "F2"s); + CHECK(sfKeyboard_getDescription(sfScanF3) == "F3"s); + CHECK(sfKeyboard_getDescription(sfScanF4) == "F4"s); + CHECK(sfKeyboard_getDescription(sfScanF5) == "F5"s); + CHECK(sfKeyboard_getDescription(sfScanF6) == "F6"s); + CHECK(sfKeyboard_getDescription(sfScanF7) == "F7"s); + CHECK(sfKeyboard_getDescription(sfScanF8) == "F8"s); + CHECK(sfKeyboard_getDescription(sfScanF9) == "F9"s); + CHECK(sfKeyboard_getDescription(sfScanF10) == "F10"s); + CHECK(sfKeyboard_getDescription(sfScanF11) == "F11"s); + CHECK(sfKeyboard_getDescription(sfScanF12) == "F12"s); + } }