diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 14:40:22 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 21:22:22 +0300 |
commit | e85b1857968d4c0378b9778650c30b9d2bca3ea9 (patch) | |
tree | ec6de5be2bcf71e44a3ba83c87bc15363d51edc6 /tests/basic | |
parent | 6a76192fa4bb8c5757c32cf3c65c4e7e7f6c7c3e (diff) | |
download | qmk_firmware-e85b1857968d4c0378b9778650c30b9d2bca3ea9.tar.gz |
Test two keys pressed at once
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/test.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/basic/test.cpp b/tests/basic/test.cpp index 804642eae..398063fca 100644 --- a/tests/basic/test.cpp +++ b/tests/basic/test.cpp @@ -51,6 +51,20 @@ TEST(KeyPress, CorrectKeyIsReportedWhenPressed) { EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A))); keyboard_task(); } - EXPECT_CALL(driver, send_keyboard_mock(_)); + +TEST(KeyPress, CorrectKeysAreReportedWhenTwoKeysArePressed) { + TestDriver driver; + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + keyboard_init(); + press_key(1, 0); + press_key(0, 1); + EXPECT_CALL(driver, keyboard_leds_mock()).WillRepeatedly(Return(0)); + //TODO: This is a left-over from the previous test and need to be fixed + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())); + keyboard_task(); + //Note that QMK only processes one key at a time + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_B))); + keyboard_task(); + EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_B, KC_C))); keyboard_task(); } |