diff options
author | Pascal Getreuer <[email protected]> | 2023-05-20 05:35:06 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-20 22:35:06 +1000 |
commit | 3993b15f054265071730cdb450f43457dcf4c64a (patch) | |
tree | 61c5b980ed14428bae3c0278c27937dbb5d33627 /tests/test_common/test_driver.hpp | |
parent | e1766df185869d8a591228d37f3f7b6d5b4049b4 (diff) | |
download | qmk_firmware-3993b15f054265071730cdb450f43457dcf4c64a.tar.gz qmk_firmware-3993b15f054265071730cdb450f43457dcf4c64a.zip |
[Core] Add Repeat Key ("repeat last key") as a core feature. (#19700)
Co-authored-by: casuanoob <[email protected]>
Co-authored-by: Sergey Vlasov <[email protected]>
Diffstat (limited to 'tests/test_common/test_driver.hpp')
-rw-r--r-- | tests/test_common/test_driver.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp index 8d09e44840..d8a6885d0f 100644 --- a/tests/test_common/test_driver.hpp +++ b/tests/test_common/test_driver.hpp @@ -20,6 +20,7 @@ #include <stdint.h> #include "host.h" #include "keyboard_report_util.hpp" +#include "keycode_util.hpp" #include "test_logger.hpp" class TestDriver { @@ -98,6 +99,17 @@ class TestDriver { */ #define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0) +/** @brief Tests whether keycode `actual` is equal to `expected`. */ +#define EXPECT_KEYCODE_EQ(actual, expected) EXPECT_THAT((actual), KeycodeEq((expected))) + +MATCHER_P(KeycodeEq, expected_keycode, "is equal to " + testing::PrintToString(expected_keycode) + ", keycode " + get_keycode_identifier_or_default(expected_keycode)) { + if (arg == expected_keycode) { + return true; + } + *result_listener << "keycode " << get_keycode_identifier_or_default(arg); + return false; +} + /** * @brief Verify and clear all gmock expectations that have been setup until * this point. |