summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-06-17 15:18:30 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-06-18 21:22:22 +0300
commitc38589d8615ba3ff93736cb02d12b3c8ceb68094 (patch)
treec8356093e760c82cc0143ca9b7ae31c3e0e0bcae /tests/basic
parent3bb0586acc6472380365d78ee81a332aca468239 (diff)
Fix the order of init and driver creation
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/basic/test.cpp b/tests/basic/test.cpp
index ce9a0cd726..e3190085d6 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(_));