Skip to content

Commit

Permalink
Fix the order of init and driver creation
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Jun 18, 2017
1 parent 3bb0586 commit c38589d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/basic/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(_));
Expand Down

0 comments on commit c38589d

Please sign in to comment.