diff options
Diffstat (limited to 'tests')
21 files changed, 257 insertions, 251 deletions
diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index a83f436c33..1d80634b2f 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -37,14 +37,14 @@ TEST_F(AutoShift, key_release_before_timeout) { EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (KC_A)); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(AutoShift, key_release_after_timeout) { @@ -58,7 +58,7 @@ TEST_F(AutoShift, key_release_after_timeout) { EXPECT_NO_REPORT(driver); regular_key.press(); idle_for(AUTO_SHIFT_TIMEOUT); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_REPORT(driver, (KC_LSFT, KC_A)); @@ -66,5 +66,5 @@ TEST_F(AutoShift, key_release_after_timeout) { EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/autocorrect/test_autocorrect.cpp b/tests/autocorrect/test_autocorrect.cpp index 509c1c9ea4..9b8db3d68d 100644 --- a/tests/autocorrect/test_autocorrect.cpp +++ b/tests/autocorrect/test_autocorrect.cpp @@ -51,7 +51,7 @@ TEST_F(AutoCorrect, OnOffToggle) { autocorrect_toggle(); EXPECT_EQ(autocorrect_is_enabled(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test that typing "fales" autocorrects to "false" @@ -80,7 +80,7 @@ TEST_F(AutoCorrect, fales_to_false_autocorrection) { TapKeys(key_f, key_a, key_l, key_e, key_s); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test that typing "fales" doesn't autocorrect if disabled @@ -109,7 +109,7 @@ TEST_F(AutoCorrect, fales_disabled_autocorrect) { TapKeys(key_f, key_a, key_l, key_e, key_s); autocorrect_enable(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test that typing "falsify" doesn't autocorrect if disabled @@ -139,7 +139,7 @@ TEST_F(AutoCorrect, falsify_should_not_autocorrect) { TapKeys(key_f, key_a, key_l, key_s, key_i, key_f, key_y); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test that typing "ture" autocorrect to "true" @@ -169,7 +169,7 @@ TEST_F(AutoCorrect, ture_to_true_autocorrect) { TapKeys(key_space, key_t_code, key_u, key_r, key_e); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test that typing "overture" does not autocorrect @@ -200,5 +200,5 @@ TEST_F(AutoCorrect, overture_should_not_autocorrect) { TapKeys(key_o, key_v, key_e, key_r, key_t_code, key_u, key_r, key_e); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_action_layer.cpp b/tests/basic/test_action_layer.cpp index d0a28d42c0..883d99b404 100644 --- a/tests/basic/test_action_layer.cpp +++ b/tests/basic/test_action_layer.cpp @@ -28,7 +28,7 @@ TEST_F(ActionLayer, LayerStateDBG) { layer_state_set(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateSet) { @@ -39,7 +39,7 @@ TEST_F(ActionLayer, LayerStateSet) { layer_state_set(0b001100); EXPECT_EQ(layer_state, 0b001100); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateIs) { @@ -56,7 +56,7 @@ TEST_F(ActionLayer, LayerStateIs) { EXPECT_EQ(layer_state_is(1), true); EXPECT_EQ(layer_state_is(2), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerStateCmp) { @@ -76,7 +76,7 @@ TEST_F(ActionLayer, LayerStateCmp) { EXPECT_EQ(layer_state_cmp(prev_layer, 1), true); EXPECT_EQ(layer_state_cmp(prev_layer, 2), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerClear) { @@ -85,7 +85,7 @@ TEST_F(ActionLayer, LayerClear) { layer_clear(); EXPECT_EQ(layer_state, 0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerMove) { @@ -96,7 +96,7 @@ TEST_F(ActionLayer, LayerMove) { layer_move(3); EXPECT_EQ(layer_state, 0b1000); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerOn) { @@ -108,7 +108,7 @@ TEST_F(ActionLayer, LayerOn) { layer_on(3); EXPECT_EQ(layer_state, 0b1010); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerOff) { @@ -121,7 +121,7 @@ TEST_F(ActionLayer, LayerOff) { layer_off(2); EXPECT_EQ(layer_state, 0b0010); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, MomentaryLayerDoesNothing) { @@ -134,12 +134,12 @@ TEST_F(ActionLayer, MomentaryLayerDoesNothing) { EXPECT_NO_REPORT(driver); layer_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, MomentaryLayerWithKeypress) { @@ -155,28 +155,28 @@ TEST_F(ActionLayer, MomentaryLayerWithKeypress) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press key on layer 1 */ EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release key on layer 1 */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release MO */ EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, ToggleLayerDoesNothing) { @@ -192,14 +192,14 @@ TEST_F(ActionLayer, ToggleLayerDoesNothing) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release TG. */ EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, ToggleLayerUpAndDown) { @@ -216,26 +216,26 @@ TEST_F(ActionLayer, ToggleLayerUpAndDown) { toggle_layer_1_on_layer_0.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); toggle_layer_1_on_layer_0.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Toggle Layer 0. */ EXPECT_NO_REPORT(driver); toggle_layer_0_on_layer_1.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); toggle_layer_0_on_layer_1.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleDoesNothing) { @@ -251,13 +251,13 @@ TEST_F(ActionLayer, LayerTapToggleDoesNothing) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleWithKeypress) { @@ -275,25 +275,25 @@ TEST_F(ActionLayer, LayerTapToggleWithKeypress) { layer_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_NO_REPORT(driver); layer_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { @@ -344,19 +344,19 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_B)).Times(1); regular_key.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { @@ -373,7 +373,7 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { layer_0_key_0.press(); idle_for(TAPPING_TERM); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press key with layer 1 mapping, result basically expected * altough more reports are send then necessary. */ @@ -382,14 +382,14 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { layer_1_key_1.press(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(1)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer tap key, no report is send because key is still held. */ EXPECT_NO_REPORT(driver); layer_0_key_0.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Unregister keycode and modifier. */ EXPECT_REPORT(driver, (KC_RALT)).Times(1); @@ -397,5 +397,5 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { layer_1_key_1.release(); run_one_scan_loop(); EXPECT_TRUE(layer_state_is(0)); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_keypress.cpp b/tests/basic/test_keypress.cpp index 6d5b502a00..34682654b0 100644 --- a/tests/basic/test_keypress.cpp +++ b/tests/basic/test_keypress.cpp @@ -175,23 +175,23 @@ TEST_F(KeyPress, PressPlusEqualReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_REPORT(driver, (key_eql.report_code)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { @@ -206,24 +206,24 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); // BUG: Should really still return KC_EQUAL, but this is fine too EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_NO_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { @@ -237,24 +237,24 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { @@ -268,7 +268,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); // BUG: The sequence is a bit strange, but it works, the end result is that @@ -277,16 +277,16 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); // I guess it's fine to still report shift here EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_one_shot_keys.cpp b/tests/basic/test_one_shot_keys.cpp index bb14221140..2401c2c837 100644 --- a/tests/basic/test_one_shot_keys.cpp +++ b/tests/basic/test_one_shot_keys.cpp @@ -36,12 +36,12 @@ TEST_F(OneShot, OSMWithoutAdditionalKeypressDoesNothing) { run_one_scan_loop(); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* OSM are added when an actual report is send */ EXPECT_REPORT(driver, (osm_key.report_code)); send_keyboard_report(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Make unit-test pass */ clear_oneshot_mods(); @@ -62,19 +62,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMExpiredDoesNothing) { run_one_scan_loop(); osm_key.release(); idle_for(ONESHOT_TIMEOUT); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } #endif @@ -92,19 +92,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMWithAdditionalKeypress) { run_one_scan_loop(); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)).Times(1); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { @@ -120,26 +120,26 @@ TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypres EXPECT_NO_REPORT(driver); osm_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_NO_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSM */ EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); EXPECT_EMPTY_REPORT(driver); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off @@ -172,24 +172,24 @@ TEST_F(OneShot, OSLWithAdditionalKeypress) { EXPECT_NO_REPORT(driver); osl_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSL key */ EXPECT_NO_REPORT(driver); osl_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); EXPECT_EMPTY_REPORT(driver); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key */ EXPECT_NO_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/basic/test_tapping.cpp b/tests/basic/test_tapping.cpp index faf9b9fe91..3246f9cdfb 100644 --- a/tests/basic/test_tapping.cpp +++ b/tests/basic/test_tapping.cpp @@ -134,7 +134,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { // Shift is reported EXPECT_REPORT(driver, (KC_LSFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); mod_tap_hold_key.press(); // Tapping keys does nothing on press @@ -145,7 +145,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { // Releasing shift is delayed while tapping is in progress EXPECT_NO_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); mod_tap_hold_key.release(); // Releasing mod-tap key reports the tap and releases shift @@ -153,7 +153,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { @@ -180,7 +180,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { // Releasing layer is delayed while tapping is in progress EXPECT_NO_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); mod_tap_hold_key1.release(); // Releasing mod-tap key reports the tap of the layer 1 key @@ -188,5 +188,5 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { EXPECT_REPORT(driver, (KC_Q)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp b/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp index ba21c527a6..01b1a78a5f 100644 --- a/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp +++ b/tests/caps_word/caps_word_autoshift/test_caps_word_autoshift.cpp @@ -64,7 +64,7 @@ TEST_F(CapsWord, AutoShiftKeys) { tap_key(key_spc); tap_key(key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test Caps Word + Auto Shift where keys A and B are rolled. @@ -104,7 +104,7 @@ TEST_F(CapsWord, AutoShiftRolledShiftedKeys) { run_one_scan_loop(); caps_word_off(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that with tap-hold keys with Retro Shift, letter keys are shifted by @@ -133,5 +133,5 @@ TEST_F(CapsWord, RetroShiftKeys) { tap_key(key_modtap_a); // Tap A quickly. EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp b/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp index 3a0530b854..0876cc91a3 100644 --- a/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp +++ b/tests/caps_word/caps_word_combo/test_caps_word_combo.cpp @@ -102,7 +102,7 @@ TEST_P(CapsWord, SingleCombo) { EXPECT_TRUE(is_caps_word_on()); caps_word_off(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test a longer 4-key combo. @@ -123,7 +123,7 @@ TEST_P(CapsWord, LongerCombo) { EXPECT_TRUE(is_caps_word_on()); caps_word_off(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test with two overlapping combos on regular keys: @@ -161,7 +161,7 @@ TEST_P(CapsWord, ComboRegularKeys) { tap_key(key_a); EXPECT_FALSE(is_caps_word_on()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Test where combo chords involve tap-hold keys: @@ -194,7 +194,7 @@ TEST_P(CapsWord, ComboModTapKey) { EXPECT_TRUE(is_caps_word_on()); caps_word_off(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off diff --git a/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp b/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp index fb8f9333bb..01cdfd6408 100644 --- a/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp +++ b/tests/caps_word/caps_word_unicodemap/test_caps_word_unicodemap.cpp @@ -93,7 +93,7 @@ TEST_F(CapsWord, ShiftedUnicodeMapKey) { tap_keys(key_delta, key_spc, key_delta); EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests typing U_ENDASH while Caps Word is on. @@ -117,5 +117,5 @@ TEST_F(CapsWord, UnshiftedUnicodeMapKey) { tap_key(key_dash); EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/caps_word/test_caps_word.cpp b/tests/caps_word/test_caps_word.cpp index fa970c7d0e..6d38b383f3 100644 --- a/tests/caps_word/test_caps_word.cpp +++ b/tests/caps_word/test_caps_word.cpp @@ -90,7 +90,7 @@ TEST_F(CapsWord, OnOffToggleFuns) { caps_word_toggle(); EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests the default `caps_word_press_user()` function. @@ -133,7 +133,7 @@ TEST_F(CapsWord, CapswrdKey) { tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key again. EXPECT_EQ(is_caps_word_on(), false); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that being idle for CAPS_WORD_IDLE_TIMEOUT turns off Caps Word. @@ -157,7 +157,7 @@ TEST_F(CapsWord, IdleTimeout) { caps_word_on(); tap_key(key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); idle_for(CAPS_WORD_IDLE_TIMEOUT); run_one_scan_loop(); @@ -171,7 +171,7 @@ TEST_F(CapsWord, IdleTimeout) { EXPECT_REPORT(driver, (KC_A)); tap_key(key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "A, 4, A, 4" produces "Shift+A, 4, Shift+A, 4". @@ -201,7 +201,7 @@ TEST_F(CapsWord, ShiftsLettersButNotDigits) { caps_word_on(); tap_keys(key_a, key_4, key_a, key_4); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "A, Space, A" produces "Shift+A, Space, A". @@ -230,7 +230,7 @@ TEST_F(CapsWord, SpaceTurnsOffCapsWord) { caps_word_on(); tap_keys(key_a, key_spc, key_a); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that typing "AltGr + A" produces "Shift + AltGr + A". @@ -260,7 +260,7 @@ TEST_F(CapsWord, ShiftsAltGrSymbols) { run_one_scan_loop(); key_altgr.release(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests typing "AltGr + A" using a mod-tap key. @@ -291,7 +291,7 @@ TEST_F(CapsWord, ShiftsModTapAltGrSymbols) { key_altgr_t.release(); EXPECT_TRUE(is_caps_word_on()); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } struct CapsWordPressUserParams { @@ -326,7 +326,7 @@ TEST_P(CapsWordPressUser, KeyCode) { EXPECT_EQ(passed_keycode, GetParam().expected_passed_keycode); EXPECT_EQ(is_caps_word_on(), GetParam().continues_caps_word); clear_oneshot_mods(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } const uint16_t LT_1_KC_A = LT(1, KC_A); @@ -431,7 +431,7 @@ TEST_P(CapsWordBothShifts, PressLRLR) { EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Pressing shifts as "Left down, Right down, Right up, Left up". @@ -468,7 +468,7 @@ TEST_P(CapsWordBothShifts, PressLRRL) { EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off @@ -524,7 +524,7 @@ TEST_P(CapsWordDoubleTapShift, Activation) { EXPECT_EQ(is_caps_word_on(), true); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(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 @@ -562,7 +562,7 @@ TEST_P(CapsWordDoubleTapShift, Interrupted) { EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. clear_oneshot_mods(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Double tap doesn't count if taps are more than tapping term apart. @@ -585,7 +585,7 @@ TEST_P(CapsWordDoubleTapShift, SlowTaps) { EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. clear_oneshot_mods(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off @@ -623,7 +623,7 @@ TEST_F(CapsWord, IgnoresOSLHold) { key_osl.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // Tests that tapping a OSL keeps caps word active |