summaryrefslogtreecommitdiffstats
path: root/tests/tap_hold_configurations/retro_tapping
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-12-18 21:55:14 +0100
committerGitHub <noreply@github.com>2022-12-18 21:55:14 +0100
commitc2b13bd77b71ea73db12a6cda64871565036a6dc (patch)
treee24c99abb8260a929b9fcc4cba21705475514c07 /tests/tap_hold_configurations/retro_tapping
parent7aa2d791f69244a5f17ec0d00908ec5a05d21103 (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/retro_tapping')
-rw-r--r--tests/tap_hold_configurations/retro_tapping/test_tap_hold.cpp4
-rw-r--r--tests/tap_hold_configurations/retro_tapping/test_tapping.cpp22
2 files changed, 13 insertions, 13 deletions
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);
}