[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>
This commit is contained in:
parent
d603fb0913
commit
c9d62ddc78
15 changed files with 17 additions and 1009 deletions
|
@ -20,7 +20,9 @@
|
|||
#include <stdint.h>
|
||||
#include "host.h"
|
||||
#include "keyboard_report_util.hpp"
|
||||
#include "keycode_util.hpp"
|
||||
extern "C" {
|
||||
#include "keycode_string.h"
|
||||
}
|
||||
#include "test_logger.hpp"
|
||||
|
||||
class TestDriver {
|
||||
|
@ -146,11 +148,11 @@ class TestDriver {
|
|||
/** @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)) {
|
||||
MATCHER_P(KeycodeEq, expected_keycode, "is equal to " + testing::PrintToString(expected_keycode) + ", keycode " + get_keycode_string(expected_keycode)) {
|
||||
if (arg == expected_keycode) {
|
||||
return true;
|
||||
}
|
||||
*result_listener << "keycode " << get_keycode_identifier_or_default(arg);
|
||||
*result_listener << "keycode " << get_keycode_string(arg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue