diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2022-12-18 21:55:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-18 21:55:14 +0100 |
commit | c2b13bd77b71ea73db12a6cda64871565036a6dc (patch) | |
tree | e24c99abb8260a929b9fcc4cba21705475514c07 /tests/tap_hold_configurations | |
parent | 7aa2d791f69244a5f17ec0d00908ec5a05d21103 (diff) |
Introduce VERIFY_AND_CLEAR shorthand (#19370)
Which is just a syntactic sugar for
testing::Mock::VerifyAndClearExpectations to reduce the visual clutter
in unit-tests.
Diffstat (limited to 'tests/tap_hold_configurations')
8 files changed, 134 insertions, 134 deletions
diff --git a/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp b/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp index 01943c10d2..6d82af6725 100644 --- a/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/default_mod_tap/test_tap_hold.cpp @@ -38,19 +38,19 @@ TEST_F(DefaultTapHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_hold_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 mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); @@ -59,11 +59,11 @@ TEST_F(DefaultTapHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of mod tap hold key. */ idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { @@ -78,19 +78,19 @@ TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); first_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap-hold key */ EXPECT_REPORT(driver, (KC_P)); @@ -99,7 +99,7 @@ TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); first_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { @@ -115,19 +115,19 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_hold_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 layer-tap-hold key */ EXPECT_REPORT(driver, (KC_P)); @@ -136,7 +136,7 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { @@ -150,26 +150,26 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod-tap-hold key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { @@ -183,26 +183,26 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod-tap-hold key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { @@ -216,11 +216,11 @@ TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); mod_tap_hold_key.press(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp b/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp index e77c756624..84a6f6996d 100644 --- a/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/hold_on_other_key_press/test_tap_hold.cpp @@ -38,26 +38,26 @@ TEST_F(HoldOnOtherKeyPress, short_distinct_taps_of_mod_tap_key_and_regular_key) EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_A)); 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_F(HoldOnOtherKeyPress, long_distinct_taps_of_mod_tap_key_and_regular_key) { @@ -72,30 +72,30 @@ TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_mod_tap_key_and_regular_key) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of mod tap hold key. */ EXPECT_REPORT(driver, (KC_LSFT)); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_A)); 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_F(HoldOnOtherKeyPress, short_distinct_taps_of_layer_tap_key_and_regular_key) { @@ -111,26 +111,26 @@ TEST_F(HoldOnOtherKeyPress, short_distinct_taps_of_layer_tap_key_and_regular_key EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_A)); 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_F(HoldOnOtherKeyPress, long_distinct_taps_of_layer_tap_key_and_regular_key) { @@ -146,30 +146,30 @@ TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_layer_tap_key_and_regular_key) EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of layer tap hold key. */ EXPECT_NO_REPORT(driver); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key. */ EXPECT_NO_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_A)); 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_F(HoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held) { @@ -184,30 +184,30 @@ TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_LSFT)); EXPECT_REPORT(driver, (KC_A, KC_LSFT)); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release regular key. */ EXPECT_REPORT(driver, (KC_LSFT)); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of mod tap hold key. */ idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(HoldOnOtherKeyPress, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { @@ -222,26 +222,26 @@ TEST_F(HoldOnOtherKeyPress, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) EXPECT_NO_REPORT(driver); first_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second tap-hold key */ EXPECT_REPORT(driver, (KC_LSFT)); second_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second tap-hold key */ EXPECT_REPORT(driver, (KC_A, KC_LSFT)); EXPECT_REPORT(driver, (KC_LSFT)); second_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap-hold key */ EXPECT_EMPTY_REPORT(driver); first_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_layer_tap_key_is_held) { @@ -257,25 +257,25 @@ TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (KC_B)); 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); /* Release layer-tap-hold key */ EXPECT_NO_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_0_layer_tap_keys) { @@ -293,25 +293,25 @@ TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_0_layer_tap_keys) { EXPECT_NO_REPORT(driver); first_layer_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second layer-tap key */ EXPECT_REPORT(driver, (KC_Q)); second_layer_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second layer-tap key */ EXPECT_EMPTY_REPORT(driver); second_layer_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first layer-tap key */ EXPECT_NO_REPORT(driver); first_layer_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { @@ -331,26 +331,26 @@ TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { EXPECT_NO_REPORT(driver); first_key_layer_0.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second layer-tap key */ EXPECT_NO_REPORT(driver); second_key_layer_0.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second layer-tap key */ EXPECT_REPORT(driver, (KC_Q)); EXPECT_EMPTY_REPORT(driver); second_key_layer_0.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first layer-tap key */ EXPECT_NO_REPORT(driver); first_key_layer_0.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { @@ -365,26 +365,26 @@ TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key. */ EXPECT_REPORT(driver, (KC_LSFT)); EXPECT_REPORT(driver, (KC_A, KC_LSFT)); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ EXPECT_REPORT(driver, (KC_A)); mod_tap_hold_key.release(); 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_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { @@ -401,23 +401,23 @@ TEST_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { EXPECT_NO_REPORT(driver); layer_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press regular key */ EXPECT_REPORT(driver, (KC_B)); regular_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key */ EXPECT_NO_REPORT(driver); layer_tap_hold_key.release(); 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); } diff --git a/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp b/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp index 1328b5fc0f..81f7fe718e 100644 --- a/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp +++ b/tests/tap_hold_configurations/permissive_hold/test_one_shot_keys.cpp @@ -35,26 +35,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_REPORT(driver, (osm_key.report_code)).Times(2); EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release OSM */ EXPECT_EMPTY_REPORT(driver).Times(1); osm_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } // clang-format off diff --git a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp index e6ecc86401..8acae6ae67 100644 --- a/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/permissive_hold/test_tap_hold.cpp @@ -37,13 +37,13 @@ TEST_F(PermissiveHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_hold_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_REPORT(driver, (KC_LEFT_SHIFT)); @@ -51,13 +51,13 @@ TEST_F(PermissiveHold, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key */ EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(PermissiveHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { @@ -72,13 +72,13 @@ TEST_F(PermissiveHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); first_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second mod-tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_hold_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second mod-tap-hold key */ EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); @@ -86,13 +86,13 @@ TEST_F(PermissiveHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); second_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap-hold key */ EXPECT_EMPTY_REPORT(driver); first_mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { @@ -108,24 +108,24 @@ TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_hold_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_REPORT(driver, (layer_key.report_code)); EXPECT_EMPTY_REPORT(driver); regular_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release layer-tap-hold key */ EXPECT_NO_REPORT(driver); layer_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp b/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp index 9c3b38050a..44dd14c033 100644 --- a/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp +++ b/tests/tap_hold_configurations/quick_tap/test_action_layer.cpp @@ -66,17 +66,17 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_A)).Times(1); regular_key.press(); run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver).Times(1); regular_key.release(); run_one_scan_loop(); expect_layer_state(0); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp b/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp index e2f8c51340..8ec6ea62a3 100644 --- a/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp +++ b/tests/tap_hold_configurations/quick_tap/test_quick_tap.cpp @@ -39,32 +39,32 @@ TEST_F(QuickTap, tap_regular_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); mod_tap_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 mod-tap key. */ EXPECT_REPORT(driver, (KC_LSFT)); mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of mod tap hold key. */ EXPECT_REPORT(driver, (KC_LSFT, KC_A)); EXPECT_REPORT(driver, (KC_LSFT)); EXPECT_EMPTY_REPORT(driver); idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_mod_tap_key_while_mod_tap_key_is_held) { @@ -79,32 +79,32 @@ TEST_F(QuickTap, tap_mod_tap_key_while_mod_tap_key_is_held) { EXPECT_NO_REPORT(driver); first_mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press second mod-tap key */ EXPECT_NO_REPORT(driver); second_mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release second tap-hold key */ EXPECT_NO_REPORT(driver); second_mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release first mod-tap key */ EXPECT_REPORT(driver, (KC_LSFT)); first_mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Idle for tapping term of first mod-tap key. */ EXPECT_REPORT(driver, (KC_LSFT, KC_A)); EXPECT_REPORT(driver, (KC_LSFT)); EXPECT_EMPTY_REPORT(driver); idle_for(TAPPING_TERM - 3); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { @@ -120,19 +120,19 @@ TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_NO_REPORT(driver); layer_tap_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 layer-tap key */ EXPECT_REPORT(driver, (KC_P)); @@ -141,7 +141,7 @@ TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { EXPECT_EMPTY_REPORT(driver); layer_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { @@ -155,7 +155,7 @@ TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_REPORT(driver, (KC_P)); @@ -163,19 +163,19 @@ TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { mod_tap_key.release(); idle_for(QUICK_TAP_TERM - 10); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press and tap mod-tap key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_key_and_hold_again_before_quick_tap_term) { @@ -189,31 +189,31 @@ TEST_F(QuickTap, tap_key_and_hold_again_before_quick_tap_term) { EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); idle_for(QUICK_TAP_TERM - 10); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press and hold mod-tap key again. */ EXPECT_REPORT(driver, (KC_P)); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Wait until tapping term expired */ EXPECT_NO_REPORT(driver); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { @@ -227,7 +227,7 @@ TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_REPORT(driver, (KC_P)); @@ -235,20 +235,20 @@ TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { mod_tap_key.release(); idle_for(QUICK_TAP_TERM + 10); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod-tap key again. */ EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(QuickTap, tap_key_and_hold_again_after_quick_tap_term) { @@ -262,29 +262,29 @@ TEST_F(QuickTap, tap_key_and_hold_again_after_quick_tap_term) { EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); idle_for(QUICK_TAP_TERM + 10); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press and hold mod-tap key again. */ EXPECT_NO_REPORT(driver); mod_tap_key.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Wait until tapping term expired */ EXPECT_REPORT(driver, (KC_LSFT)); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap key. */ EXPECT_EMPTY_REPORT(driver); mod_tap_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp b/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp index e08c600dbd..2b49cddcce 100644 --- a/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp +++ b/tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp @@ -38,7 +38,7 @@ TEST_F(RetroTapping, tap_and_hold_mod_tap_hold_key) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod-tap-hold key. */ /* TODO: Why is LSHIFT send at all? */ @@ -48,5 +48,5 @@ TEST_F(RetroTapping, tap_and_hold_mod_tap_hold_key) { EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } diff --git a/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp b/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp index 42139d50da..db81c39101 100644 --- a/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp +++ b/tests/tap_hold_configurations/retro_tapping/test_tapping.cpp @@ -35,18 +35,18 @@ TEST_F(Tapping, HoldA_SHFT_T_KeyReportsShift) { EXPECT_NO_REPORT(driver); mod_tap_hold_key.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_REPORT(driver, (KC_LSFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); mod_tap_hold_key.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { @@ -60,45 +60,45 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_REPORT(driver, (KC_P)); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ EXPECT_REPORT(driver, (KC_P)); EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); idle_for(TAPPING_TERM + 1); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Press mod_tap_hold key again */ EXPECT_NO_REPORT(driver); key_shift_hold_p_tap.press(); idle_for(TAPPING_TERM); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); /* Release mod_tap_hold key again */ /* TODO: Why is KC_LSFT send? */ @@ -108,5 +108,5 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { EXPECT_EMPTY_REPORT(driver); key_shift_hold_p_tap.release(); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } |