diff options
| author | Stefan Kerkmann <karlk90@pm.me> | 2025-03-21 08:47:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-21 08:47:22 +0100 |
| commit | c9d62ddc78e879053241202b288d0129073b07dc (patch) | |
| tree | 1e58dcea290874bf8af5ea7ca797fe3515885488 /tests/basic/test_keycode_util.cpp | |
| parent | d603fb09139a5a55e1efd910a3989e38f138446f (diff) | |
[Core] use `keycode_string` in unit tests (#25042)
* tests: use keycode_string feature
With a proper keycode to string implementation in qmk there is no need
to use the unit tests only implementation anymore.
Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
* tests: remove keycode_util feature
This feature is no longer used as we switched the tests to the
keycode string implementation.
Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
Diffstat (limited to 'tests/basic/test_keycode_util.cpp')
| -rw-r--r-- | tests/basic/test_keycode_util.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/basic/test_keycode_util.cpp b/tests/basic/test_keycode_util.cpp deleted file mode 100644 index 693334676e..0000000000 --- a/tests/basic/test_keycode_util.cpp +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | // Copyright 2022 Stefan Kerkmann | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "test_common.hpp" | ||
| 5 | |||
| 6 | class KeycodeToIdentifierSuite : public ::testing::TestWithParam<std::pair<std::uint16_t, std::string>> {}; | ||
| 7 | |||
| 8 | TEST_P(KeycodeToIdentifierSuite, ConversionTests) { | ||
| 9 | ASSERT_EQ(get_keycode_identifier_or_default(GetParam().first), GetParam().second); | ||
| 10 | } | ||
| 11 | |||
| 12 | INSTANTIATE_TEST_CASE_P(ConversionTestsP, KeycodeToIdentifierSuite, | ||
| 13 | // clang-format off | ||
| 14 | ::testing::Values( | ||
| 15 | // Goto layer | ||
| 16 | std::make_pair(TO(0), "TO(0)"), | ||
| 17 | std::make_pair(TO(0x1F), "TO(31)"), | ||
| 18 | // Momentary switch layer | ||
| 19 | std::make_pair(MO(0), "MO(0)"), | ||
| 20 | std::make_pair(MO(0x1F), "MO(31)"), | ||
| 21 | // Set default layer | ||
| 22 | std::make_pair(DF(0), "DF(0)"), | ||
| 23 | std::make_pair(DF(0x1F), "DF(31)"), | ||
| 24 | // Toggle layer | ||
| 25 | std::make_pair(TG(0), "TG(0)"), | ||
| 26 | std::make_pair(TG(0x1F), "TG(31)"), | ||
| 27 | // One-shot layer | ||
| 28 | std::make_pair(OSL(0), "OSL(0)"), | ||
| 29 | std::make_pair(OSL(0x1F), "OSL(31)"), | ||
| 30 | // One-shot mod | ||
| 31 | std::make_pair(OSM(MOD_LSFT), "OSM(MOD_LSFT)"), | ||
| 32 | std::make_pair(OSM(MOD_LSFT | MOD_LCTL), "OSM(MOD_LCTL | MOD_LSFT)"), | ||
| 33 | // Layer Mod | ||
| 34 | std::make_pair(LM(0, MOD_LSFT), "LM(0, MOD_LSFT)"), | ||
| 35 | std::make_pair(LM(0xF, MOD_LSFT), "LM(15, MOD_LSFT)"), | ||
| 36 | std::make_pair(LM(0xF, MOD_LSFT | MOD_LCTL), "LM(15, MOD_LCTL | MOD_LSFT)"), | ||
| 37 | // Layer tap toggle | ||
| 38 | std::make_pair(TT(0), "TT(0)"), | ||
| 39 | std::make_pair(TT(0x1F), "TT(31)"), | ||
| 40 | // Layer tap | ||
| 41 | std::make_pair(LT(0, KC_A), "LT(0, KC_A)"), | ||
| 42 | std::make_pair(LT(0xF, KC_SPACE), "LT(15, KC_SPACE)"), | ||
| 43 | std::make_pair(LT(1, KC_SPC), "LT(1, KC_SPACE)"), | ||
| 44 | // Mod tap | ||
| 45 | std::make_pair(MT(MOD_LCTL, KC_A), "MT(MOD_LCTL, KC_A)"), | ||
| 46 | std::make_pair(MT(MOD_LCTL | MOD_LSFT, KC_A), "MT(MOD_LCTL | MOD_LSFT, KC_A)"), | ||
| 47 | std::make_pair(ALT_T(KC_TAB), "MT(MOD_LALT, KC_TAB)"), | ||
| 48 | // Mods | ||
| 49 | std::make_pair(LCTL(KC_A), "QK_MODS(KC_A, QK_LCTL)"), | ||
| 50 | std::make_pair(HYPR(KC_SPACE), "QK_MODS(KC_SPACE, QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI)") | ||
| 51 | )); | ||
| 52 | // clang-format on | ||
