diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-06-17 14:18:30 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-06-18 20:22:22 +0200 |
commit | c38589d8615ba3ff93736cb02d12b3c8ceb68094 (patch) | |
tree | c8356093e760c82cc0143ca9b7ae31c3e0e0bcae /tests | |
parent | 3bb0586acc6472380365d78ee81a332aca468239 (diff) | |
download | qmk_firmware-c38589d8615ba3ff93736cb02d12b3c8ceb68094.tar.gz qmk_firmware-c38589d8615ba3ff93736cb02d12b3c8ceb68094.tar.xz |
Fix the order of init and driver creation
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/basic/test.cpp b/tests/basic/test.cpp index ce9a0cd72..e3190085d 100644 --- a/tests/basic/test.cpp +++ b/tests/basic/test.cpp @@ -33,16 +33,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; TEST(Basic, SendKeyboardIsNotCalledWhenNoKeyIsPressed) { - keyboard_init(); TestDriver driver; + EXPECT_CALL(driver, send_keyboard_mock(_)); + keyboard_init(); EXPECT_CALL(driver, keyboard_leds_mock()).WillRepeatedly(Return(0)); EXPECT_CALL(driver, send_keyboard_mock(_)).Times(0); keyboard_task(); } TEST(Basic, SendKeyboardIsCalledWhenAKeyIsPressed) { - keyboard_init(); 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(_)); |