Merge remote-tracking branch 'upstream/master' into fl16-july-merge
This commit is contained in:
@@ -664,6 +664,8 @@ std::map<uint16_t, std::string> KEYCODE_ID_TABLE = {
|
||||
{QK_AUTOCORRECT_TOGGLE, "QK_AUTOCORRECT_TOGGLE"},
|
||||
{QK_TRI_LAYER_LOWER, "QK_TRI_LAYER_LOWER"},
|
||||
{QK_TRI_LAYER_UPPER, "QK_TRI_LAYER_UPPER"},
|
||||
{QK_REPEAT_KEY, "QK_REPEAT_KEY"},
|
||||
{QK_ALT_REPEAT_KEY, "QK_ALT_REPEAT_KEY"},
|
||||
{QK_KB_0, "QK_KB_0"},
|
||||
{QK_KB_1, "QK_KB_1"},
|
||||
{QK_KB_2, "QK_KB_2"},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
std::string get_keycode_identifier_or_default(uint16_t keycode);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -22,7 +22,6 @@ extern "C" {
|
||||
#include "debug.h"
|
||||
#include "eeconfig.h"
|
||||
#include "keyboard.h"
|
||||
#include "keymap.h"
|
||||
|
||||
void set_time(uint32_t t);
|
||||
void advance_time(uint32_t ms);
|
||||
|
||||
Reference in New Issue
Block a user