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/basic/test_tapping.cpp | |
| 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/basic/test_tapping.cpp')
| -rw-r--r-- | tests/basic/test_tapping.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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) { | |||
| 134 | // Shift is reported | 134 | // Shift is reported |
| 135 | EXPECT_REPORT(driver, (KC_LSFT)); | 135 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 136 | run_one_scan_loop(); | 136 | run_one_scan_loop(); |
| 137 | testing::Mock::VerifyAndClearExpectations(&driver); | 137 | VERIFY_AND_CLEAR(driver); |
| 138 | 138 | ||
| 139 | mod_tap_hold_key.press(); | 139 | mod_tap_hold_key.press(); |
| 140 | // Tapping keys does nothing on press | 140 | // Tapping keys does nothing on press |
| @@ -145,7 +145,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { | |||
| 145 | // Releasing shift is delayed while tapping is in progress | 145 | // Releasing shift is delayed while tapping is in progress |
| 146 | EXPECT_NO_REPORT(driver); | 146 | EXPECT_NO_REPORT(driver); |
| 147 | run_one_scan_loop(); | 147 | run_one_scan_loop(); |
| 148 | testing::Mock::VerifyAndClearExpectations(&driver); | 148 | VERIFY_AND_CLEAR(driver); |
| 149 | 149 | ||
| 150 | mod_tap_hold_key.release(); | 150 | mod_tap_hold_key.release(); |
| 151 | // Releasing mod-tap key reports the tap and releases shift | 151 | // Releasing mod-tap key reports the tap and releases shift |
| @@ -153,7 +153,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingShift) { | |||
| 153 | EXPECT_REPORT(driver, (KC_P)); | 153 | EXPECT_REPORT(driver, (KC_P)); |
| 154 | EXPECT_EMPTY_REPORT(driver); | 154 | EXPECT_EMPTY_REPORT(driver); |
| 155 | run_one_scan_loop(); | 155 | run_one_scan_loop(); |
| 156 | testing::Mock::VerifyAndClearExpectations(&driver); | 156 | VERIFY_AND_CLEAR(driver); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { | 159 | TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { |
| @@ -180,7 +180,7 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { | |||
| 180 | // Releasing layer is delayed while tapping is in progress | 180 | // Releasing layer is delayed while tapping is in progress |
| 181 | EXPECT_NO_REPORT(driver); | 181 | EXPECT_NO_REPORT(driver); |
| 182 | run_one_scan_loop(); | 182 | run_one_scan_loop(); |
| 183 | testing::Mock::VerifyAndClearExpectations(&driver); | 183 | VERIFY_AND_CLEAR(driver); |
| 184 | 184 | ||
| 185 | mod_tap_hold_key1.release(); | 185 | mod_tap_hold_key1.release(); |
| 186 | // Releasing mod-tap key reports the tap of the layer 1 key | 186 | // Releasing mod-tap key reports the tap of the layer 1 key |
| @@ -188,5 +188,5 @@ TEST_F(Tapping, TapA_CTL_T_KeyWhileReleasingLayer) { | |||
| 188 | EXPECT_REPORT(driver, (KC_Q)); | 188 | EXPECT_REPORT(driver, (KC_Q)); |
| 189 | EXPECT_EMPTY_REPORT(driver); | 189 | EXPECT_EMPTY_REPORT(driver); |
| 190 | run_one_scan_loop(); | 190 | run_one_scan_loop(); |
| 191 | testing::Mock::VerifyAndClearExpectations(&driver); | 191 | VERIFY_AND_CLEAR(driver); |
| 192 | } | 192 | } |
