diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-17 18:18:15 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 21:22:22 +0300 |
commit | bd1729d5be376fecae67ab5ddc92eab82416a5c1 (patch) | |
tree | db71a57159556156b282292b5c76fa257a4241e2 /tests/basic | |
parent | fb95d86b39074b581455fb35a17477cce79a3738 (diff) | |
download | qmk_firmware-bd1729d5be376fecae67ab5ddc92eab82416a5c1.tar.gz qmk_firmware-bd1729d5be376fecae67ab5ddc92eab82416a5c1.zip |
Actually test for correct key presses
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/test.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/basic/test.cpp b/tests/basic/test.cpp index e3190085d6..804642eae6 100644 --- a/tests/basic/test.cpp +++ b/tests/basic/test.cpp @@ -21,6 +21,7 @@ #include "keyboard.h" #include "test_driver.h" #include "test_matrix.h" +#include "keyboard_report_util.h" using testing::_; using testing::Return; @@ -32,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -TEST(Basic, SendKeyboardIsNotCalledWhenNoKeyIsPressed) { +TEST(KeyPress, SendKeyboardIsNotCalledWhenNoKeyIsPressed) { TestDriver driver; EXPECT_CALL(driver, send_keyboard_mock(_)); keyboard_init(); @@ -41,12 +42,15 @@ TEST(Basic, SendKeyboardIsNotCalledWhenNoKeyIsPressed) { keyboard_task(); } -TEST(Basic, SendKeyboardIsCalledWhenAKeyIsPressed) { +TEST(KeyPress, CorrectKeyIsReportedWhenPressed) { TestDriver driver; EXPECT_CALL(driver, send_keyboard_mock(_)); keyboard_init(); press_key(0, 0); EXPECT_CALL(driver, keyboard_leds_mock()).WillRepeatedly(Return(0)); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); + keyboard_task(); +} EXPECT_CALL(driver, send_keyboard_mock(_)); keyboard_task(); } |