1
0
Fork 0

[Test] Reset timer for every unit test and provide timestamps for log messages (#17028)

This commit is contained in:
Stefan Kerkmann 2022-12-14 16:31:08 +01:00 committed by GitHub
parent e2ab98f960
commit 962e4c0e18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1011 additions and 41 deletions

View file

@ -505,7 +505,8 @@ class CapsWordDoubleTapShift : public ::testing::WithParamInterface<CapsWordDoub
TEST_P(CapsWordDoubleTapShift, Activation) {
TestDriver driver;
KeymapKey left_shift(0, 0, 0, GetParam().left_shift_keycode);
set_keymap({left_shift});
KeymapKey esc(0, 0, 1, KC_ESCAPE);
set_keymap({left_shift, esc});
// clang-format off
EXPECT_CALL(driver, send_keyboard_mock(AnyOf(
@ -524,6 +525,12 @@ TEST_P(CapsWordDoubleTapShift, Activation) {
EXPECT_EQ(is_caps_word_on(), true);
testing::Mock::VerifyAndClearExpectations(&driver);
// We have to manually reset the internal state of the caps word state
// machine at this point. This due to imperfect test isolation which can't
// reset the caps word double shift timer on test case setup.
idle_for(CAPS_WORD_IDLE_TIMEOUT);
tap_key(esc);
}
// Double tap doesn't count if another key is pressed between the taps.