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 | |
| 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')
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) { | |||
| 37 | EXPECT_NO_REPORT(driver); | 37 | EXPECT_NO_REPORT(driver); |
| 38 | regular_key.press(); | 38 | regular_key.press(); |
| 39 | run_one_scan_loop(); | 39 | run_one_scan_loop(); |
| 40 | testing::Mock::VerifyAndClearExpectations(&driver); | 40 | VERIFY_AND_CLEAR(driver); |
| 41 | 41 | ||
| 42 | /* Release regular key */ | 42 | /* Release regular key */ |
| 43 | EXPECT_REPORT(driver, (KC_A)); | 43 | EXPECT_REPORT(driver, (KC_A)); |
| 44 | EXPECT_EMPTY_REPORT(driver); | 44 | EXPECT_EMPTY_REPORT(driver); |
| 45 | regular_key.release(); | 45 | regular_key.release(); |
| 46 | run_one_scan_loop(); | 46 | run_one_scan_loop(); |
| 47 | testing::Mock::VerifyAndClearExpectations(&driver); | 47 | VERIFY_AND_CLEAR(driver); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | TEST_F(AutoShift, key_release_after_timeout) { | 50 | TEST_F(AutoShift, key_release_after_timeout) { |
| @@ -58,7 +58,7 @@ TEST_F(AutoShift, key_release_after_timeout) { | |||
| 58 | EXPECT_NO_REPORT(driver); | 58 | EXPECT_NO_REPORT(driver); |
| 59 | regular_key.press(); | 59 | regular_key.press(); |
| 60 | idle_for(AUTO_SHIFT_TIMEOUT); | 60 | idle_for(AUTO_SHIFT_TIMEOUT); |
| 61 | testing::Mock::VerifyAndClearExpectations(&driver); | 61 | VERIFY_AND_CLEAR(driver); |
| 62 | 62 | ||
| 63 | /* Release regular key */ | 63 | /* Release regular key */ |
| 64 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); | 64 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); |
| @@ -66,5 +66,5 @@ TEST_F(AutoShift, key_release_after_timeout) { | |||
| 66 | EXPECT_EMPTY_REPORT(driver); | 66 | EXPECT_EMPTY_REPORT(driver); |
| 67 | regular_key.release(); | 67 | regular_key.release(); |
| 68 | run_one_scan_loop(); | 68 | run_one_scan_loop(); |
| 69 | testing::Mock::VerifyAndClearExpectations(&driver); | 69 | VERIFY_AND_CLEAR(driver); |
| 70 | } | 70 | } |
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) { | |||
| 51 | autocorrect_toggle(); | 51 | autocorrect_toggle(); |
| 52 | EXPECT_EQ(autocorrect_is_enabled(), true); | 52 | EXPECT_EQ(autocorrect_is_enabled(), true); |
| 53 | 53 | ||
| 54 | testing::Mock::VerifyAndClearExpectations(&driver); | 54 | VERIFY_AND_CLEAR(driver); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | // Test that typing "fales" autocorrects to "false" | 57 | // Test that typing "fales" autocorrects to "false" |
| @@ -80,7 +80,7 @@ TEST_F(AutoCorrect, fales_to_false_autocorrection) { | |||
| 80 | 80 | ||
| 81 | TapKeys(key_f, key_a, key_l, key_e, key_s); | 81 | TapKeys(key_f, key_a, key_l, key_e, key_s); |
| 82 | 82 | ||
| 83 | testing::Mock::VerifyAndClearExpectations(&driver); | 83 | VERIFY_AND_CLEAR(driver); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | // Test that typing "fales" doesn't autocorrect if disabled | 86 | // Test that typing "fales" doesn't autocorrect if disabled |
| @@ -109,7 +109,7 @@ TEST_F(AutoCorrect, fales_disabled_autocorrect) { | |||
| 109 | TapKeys(key_f, key_a, key_l, key_e, key_s); | 109 | TapKeys(key_f, key_a, key_l, key_e, key_s); |
| 110 | autocorrect_enable(); | 110 | autocorrect_enable(); |
| 111 | 111 | ||
| 112 | testing::Mock::VerifyAndClearExpectations(&driver); | 112 | VERIFY_AND_CLEAR(driver); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | // Test that typing "falsify" doesn't autocorrect if disabled | 115 | // Test that typing "falsify" doesn't autocorrect if disabled |
| @@ -139,7 +139,7 @@ TEST_F(AutoCorrect, falsify_should_not_autocorrect) { | |||
| 139 | 139 | ||
| 140 | TapKeys(key_f, key_a, key_l, key_s, key_i, key_f, key_y); | 140 | TapKeys(key_f, key_a, key_l, key_s, key_i, key_f, key_y); |
| 141 | 141 | ||
| 142 | testing::Mock::VerifyAndClearExpectations(&driver); | 142 | VERIFY_AND_CLEAR(driver); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | // Test that typing "ture" autocorrect to "true" | 145 | // Test that typing "ture" autocorrect to "true" |
| @@ -169,7 +169,7 @@ TEST_F(AutoCorrect, ture_to_true_autocorrect) { | |||
| 169 | 169 | ||
| 170 | TapKeys(key_space, key_t_code, key_u, key_r, key_e); | 170 | TapKeys(key_space, key_t_code, key_u, key_r, key_e); |
| 171 | 171 | ||
| 172 | testing::Mock::VerifyAndClearExpectations(&driver); | 172 | VERIFY_AND_CLEAR(driver); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | // Test that typing "overture" does not autocorrect | 175 | // Test that typing "overture" does not autocorrect |
| @@ -200,5 +200,5 @@ TEST_F(AutoCorrect, overture_should_not_autocorrect) { | |||
| 200 | 200 | ||
| 201 | TapKeys(key_o, key_v, key_e, key_r, key_t_code, key_u, key_r, key_e); | 201 | TapKeys(key_o, key_v, key_e, key_r, key_t_code, key_u, key_r, key_e); |
| 202 | 202 | ||
| 203 | testing::Mock::VerifyAndClearExpectations(&driver); | 203 | VERIFY_AND_CLEAR(driver); |
| 204 | } | 204 | } |
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) { | |||
| 28 | 28 | ||
| 29 | layer_state_set(0); | 29 | layer_state_set(0); |
| 30 | 30 | ||
| 31 | testing::Mock::VerifyAndClearExpectations(&driver); | 31 | VERIFY_AND_CLEAR(driver); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | TEST_F(ActionLayer, LayerStateSet) { | 34 | TEST_F(ActionLayer, LayerStateSet) { |
| @@ -39,7 +39,7 @@ TEST_F(ActionLayer, LayerStateSet) { | |||
| 39 | layer_state_set(0b001100); | 39 | layer_state_set(0b001100); |
| 40 | EXPECT_EQ(layer_state, 0b001100); | 40 | EXPECT_EQ(layer_state, 0b001100); |
| 41 | 41 | ||
| 42 | testing::Mock::VerifyAndClearExpectations(&driver); | 42 | VERIFY_AND_CLEAR(driver); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | TEST_F(ActionLayer, LayerStateIs) { | 45 | TEST_F(ActionLayer, LayerStateIs) { |
| @@ -56,7 +56,7 @@ TEST_F(ActionLayer, LayerStateIs) { | |||
| 56 | EXPECT_EQ(layer_state_is(1), true); | 56 | EXPECT_EQ(layer_state_is(1), true); |
| 57 | EXPECT_EQ(layer_state_is(2), false); | 57 | EXPECT_EQ(layer_state_is(2), false); |
| 58 | 58 | ||
| 59 | testing::Mock::VerifyAndClearExpectations(&driver); | 59 | VERIFY_AND_CLEAR(driver); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | TEST_F(ActionLayer, LayerStateCmp) { | 62 | TEST_F(ActionLayer, LayerStateCmp) { |
| @@ -76,7 +76,7 @@ TEST_F(ActionLayer, LayerStateCmp) { | |||
| 76 | EXPECT_EQ(layer_state_cmp(prev_layer, 1), true); | 76 | EXPECT_EQ(layer_state_cmp(prev_layer, 1), true); |
| 77 | EXPECT_EQ(layer_state_cmp(prev_layer, 2), false); | 77 | EXPECT_EQ(layer_state_cmp(prev_layer, 2), false); |
| 78 | 78 | ||
| 79 | testing::Mock::VerifyAndClearExpectations(&driver); | 79 | VERIFY_AND_CLEAR(driver); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | TEST_F(ActionLayer, LayerClear) { | 82 | TEST_F(ActionLayer, LayerClear) { |
| @@ -85,7 +85,7 @@ TEST_F(ActionLayer, LayerClear) { | |||
| 85 | layer_clear(); | 85 | layer_clear(); |
| 86 | EXPECT_EQ(layer_state, 0); | 86 | EXPECT_EQ(layer_state, 0); |
| 87 | 87 | ||
| 88 | testing::Mock::VerifyAndClearExpectations(&driver); | 88 | VERIFY_AND_CLEAR(driver); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | TEST_F(ActionLayer, LayerMove) { | 91 | TEST_F(ActionLayer, LayerMove) { |
| @@ -96,7 +96,7 @@ TEST_F(ActionLayer, LayerMove) { | |||
| 96 | layer_move(3); | 96 | layer_move(3); |
| 97 | EXPECT_EQ(layer_state, 0b1000); | 97 | EXPECT_EQ(layer_state, 0b1000); |
| 98 | 98 | ||
| 99 | testing::Mock::VerifyAndClearExpectations(&driver); | 99 | VERIFY_AND_CLEAR(driver); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | TEST_F(ActionLayer, LayerOn) { | 102 | TEST_F(ActionLayer, LayerOn) { |
| @@ -108,7 +108,7 @@ TEST_F(ActionLayer, LayerOn) { | |||
| 108 | layer_on(3); | 108 | layer_on(3); |
| 109 | EXPECT_EQ(layer_state, 0b1010); | 109 | EXPECT_EQ(layer_state, 0b1010); |
| 110 | 110 | ||
| 111 | testing::Mock::VerifyAndClearExpectations(&driver); | 111 | VERIFY_AND_CLEAR(driver); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | TEST_F(ActionLayer, LayerOff) { | 114 | TEST_F(ActionLayer, LayerOff) { |
| @@ -121,7 +121,7 @@ TEST_F(ActionLayer, LayerOff) { | |||
| 121 | layer_off(2); | 121 | layer_off(2); |
| 122 | EXPECT_EQ(layer_state, 0b0010); | 122 | EXPECT_EQ(layer_state, 0b0010); |
| 123 | 123 | ||
| 124 | testing::Mock::VerifyAndClearExpectations(&driver); | 124 | VERIFY_AND_CLEAR(driver); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | TEST_F(ActionLayer, MomentaryLayerDoesNothing) { | 127 | TEST_F(ActionLayer, MomentaryLayerDoesNothing) { |
| @@ -134,12 +134,12 @@ TEST_F(ActionLayer, MomentaryLayerDoesNothing) { | |||
| 134 | EXPECT_NO_REPORT(driver); | 134 | EXPECT_NO_REPORT(driver); |
| 135 | layer_key.press(); | 135 | layer_key.press(); |
| 136 | run_one_scan_loop(); | 136 | run_one_scan_loop(); |
| 137 | testing::Mock::VerifyAndClearExpectations(&driver); | 137 | VERIFY_AND_CLEAR(driver); |
| 138 | 138 | ||
| 139 | EXPECT_NO_REPORT(driver); | 139 | EXPECT_NO_REPORT(driver); |
| 140 | layer_key.release(); | 140 | layer_key.release(); |
| 141 | run_one_scan_loop(); | 141 | run_one_scan_loop(); |
| 142 | testing::Mock::VerifyAndClearExpectations(&driver); | 142 | VERIFY_AND_CLEAR(driver); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | TEST_F(ActionLayer, MomentaryLayerWithKeypress) { | 145 | TEST_F(ActionLayer, MomentaryLayerWithKeypress) { |
| @@ -155,28 +155,28 @@ TEST_F(ActionLayer, MomentaryLayerWithKeypress) { | |||
| 155 | layer_key.press(); | 155 | layer_key.press(); |
| 156 | run_one_scan_loop(); | 156 | run_one_scan_loop(); |
| 157 | EXPECT_TRUE(layer_state_is(1)); | 157 | EXPECT_TRUE(layer_state_is(1)); |
| 158 | testing::Mock::VerifyAndClearExpectations(&driver); | 158 | VERIFY_AND_CLEAR(driver); |
| 159 | 159 | ||
| 160 | /* Press key on layer 1 */ | 160 | /* Press key on layer 1 */ |
| 161 | EXPECT_REPORT(driver, (KC_B)).Times(1); | 161 | EXPECT_REPORT(driver, (KC_B)).Times(1); |
| 162 | regular_key.press(); | 162 | regular_key.press(); |
| 163 | run_one_scan_loop(); | 163 | run_one_scan_loop(); |
| 164 | EXPECT_TRUE(layer_state_is(1)); | 164 | EXPECT_TRUE(layer_state_is(1)); |
| 165 | testing::Mock::VerifyAndClearExpectations(&driver); | 165 | VERIFY_AND_CLEAR(driver); |
| 166 | 166 | ||
| 167 | /* Release key on layer 1 */ | 167 | /* Release key on layer 1 */ |
| 168 | EXPECT_EMPTY_REPORT(driver); | 168 | EXPECT_EMPTY_REPORT(driver); |
| 169 | regular_key.release(); | 169 | regular_key.release(); |
| 170 | run_one_scan_loop(); | 170 | run_one_scan_loop(); |
| 171 | EXPECT_TRUE(layer_state_is(1)); | 171 | EXPECT_TRUE(layer_state_is(1)); |
| 172 | testing::Mock::VerifyAndClearExpectations(&driver); | 172 | VERIFY_AND_CLEAR(driver); |
| 173 | 173 | ||
| 174 | /* Release MO */ | 174 | /* Release MO */ |
| 175 | EXPECT_NO_REPORT(driver); | 175 | EXPECT_NO_REPORT(driver); |
| 176 | layer_key.release(); | 176 | layer_key.release(); |
| 177 | run_one_scan_loop(); | 177 | run_one_scan_loop(); |
| 178 | EXPECT_TRUE(layer_state_is(0)); | 178 | EXPECT_TRUE(layer_state_is(0)); |
| 179 | testing::Mock::VerifyAndClearExpectations(&driver); | 179 | VERIFY_AND_CLEAR(driver); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | TEST_F(ActionLayer, ToggleLayerDoesNothing) { | 182 | TEST_F(ActionLayer, ToggleLayerDoesNothing) { |
| @@ -192,14 +192,14 @@ TEST_F(ActionLayer, ToggleLayerDoesNothing) { | |||
| 192 | layer_key.press(); | 192 | layer_key.press(); |
| 193 | run_one_scan_loop(); | 193 | run_one_scan_loop(); |
| 194 | EXPECT_TRUE(layer_state_is(1)); | 194 | EXPECT_TRUE(layer_state_is(1)); |
| 195 | testing::Mock::VerifyAndClearExpectations(&driver); | 195 | VERIFY_AND_CLEAR(driver); |
| 196 | 196 | ||
| 197 | /* Release TG. */ | 197 | /* Release TG. */ |
| 198 | EXPECT_NO_REPORT(driver); | 198 | EXPECT_NO_REPORT(driver); |
| 199 | layer_key.release(); | 199 | layer_key.release(); |
| 200 | run_one_scan_loop(); | 200 | run_one_scan_loop(); |
| 201 | EXPECT_TRUE(layer_state_is(1)); | 201 | EXPECT_TRUE(layer_state_is(1)); |
| 202 | testing::Mock::VerifyAndClearExpectations(&driver); | 202 | VERIFY_AND_CLEAR(driver); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | TEST_F(ActionLayer, ToggleLayerUpAndDown) { | 205 | TEST_F(ActionLayer, ToggleLayerUpAndDown) { |
| @@ -216,26 +216,26 @@ TEST_F(ActionLayer, ToggleLayerUpAndDown) { | |||
| 216 | toggle_layer_1_on_layer_0.press(); | 216 | toggle_layer_1_on_layer_0.press(); |
| 217 | run_one_scan_loop(); | 217 | run_one_scan_loop(); |
| 218 | EXPECT_TRUE(layer_state_is(1)); | 218 | EXPECT_TRUE(layer_state_is(1)); |
| 219 | testing::Mock::VerifyAndClearExpectations(&driver); | 219 | VERIFY_AND_CLEAR(driver); |
| 220 | 220 | ||
| 221 | EXPECT_NO_REPORT(driver); | 221 | EXPECT_NO_REPORT(driver); |
| 222 | toggle_layer_1_on_layer_0.release(); | 222 | toggle_layer_1_on_layer_0.release(); |
| 223 | run_one_scan_loop(); | 223 | run_one_scan_loop(); |
| 224 | EXPECT_TRUE(layer_state_is(1)); | 224 | EXPECT_TRUE(layer_state_is(1)); |
| 225 | testing::Mock::VerifyAndClearExpectations(&driver); | 225 | VERIFY_AND_CLEAR(driver); |
| 226 | 226 | ||
| 227 | /* Toggle Layer 0. */ | 227 | /* Toggle Layer 0. */ |
| 228 | EXPECT_NO_REPORT(driver); | 228 | EXPECT_NO_REPORT(driver); |
| 229 | toggle_layer_0_on_layer_1.press(); | 229 | toggle_layer_0_on_layer_1.press(); |
| 230 | run_one_scan_loop(); | 230 | run_one_scan_loop(); |
| 231 | EXPECT_TRUE(layer_state_is(0)); | 231 | EXPECT_TRUE(layer_state_is(0)); |
| 232 | testing::Mock::VerifyAndClearExpectations(&driver); | 232 | VERIFY_AND_CLEAR(driver); |
| 233 | 233 | ||
| 234 | EXPECT_NO_REPORT(driver); | 234 | EXPECT_NO_REPORT(driver); |
| 235 | toggle_layer_0_on_layer_1.release(); | 235 | toggle_layer_0_on_layer_1.release(); |
| 236 | run_one_scan_loop(); | 236 | run_one_scan_loop(); |
| 237 | EXPECT_TRUE(layer_state_is(0)); | 237 | EXPECT_TRUE(layer_state_is(0)); |
| 238 | testing::Mock::VerifyAndClearExpectations(&driver); | 238 | VERIFY_AND_CLEAR(driver); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | TEST_F(ActionLayer, LayerTapToggleDoesNothing) { | 241 | TEST_F(ActionLayer, LayerTapToggleDoesNothing) { |
| @@ -251,13 +251,13 @@ TEST_F(ActionLayer, LayerTapToggleDoesNothing) { | |||
| 251 | layer_key.press(); | 251 | layer_key.press(); |
| 252 | run_one_scan_loop(); | 252 | run_one_scan_loop(); |
| 253 | EXPECT_TRUE(layer_state_is(1)); | 253 | EXPECT_TRUE(layer_state_is(1)); |
| 254 | testing::Mock::VerifyAndClearExpectations(&driver); | 254 | VERIFY_AND_CLEAR(driver); |
| 255 | 255 | ||
| 256 | EXPECT_NO_REPORT(driver); | 256 | EXPECT_NO_REPORT(driver); |
| 257 | layer_key.release(); | 257 | layer_key.release(); |
| 258 | run_one_scan_loop(); | 258 | run_one_scan_loop(); |
| 259 | EXPECT_TRUE(layer_state_is(0)); | 259 | EXPECT_TRUE(layer_state_is(0)); |
| 260 | testing::Mock::VerifyAndClearExpectations(&driver); | 260 | VERIFY_AND_CLEAR(driver); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | TEST_F(ActionLayer, LayerTapToggleWithKeypress) { | 263 | TEST_F(ActionLayer, LayerTapToggleWithKeypress) { |
| @@ -275,25 +275,25 @@ TEST_F(ActionLayer, LayerTapToggleWithKeypress) { | |||
| 275 | layer_key.press(); | 275 | layer_key.press(); |
| 276 | run_one_scan_loop(); | 276 | run_one_scan_loop(); |
| 277 | EXPECT_TRUE(layer_state_is(1)); | 277 | EXPECT_TRUE(layer_state_is(1)); |
| 278 | testing::Mock::VerifyAndClearExpectations(&driver); | 278 | VERIFY_AND_CLEAR(driver); |
| 279 | 279 | ||
| 280 | EXPECT_REPORT(driver, (KC_B)).Times(1); | 280 | EXPECT_REPORT(driver, (KC_B)).Times(1); |
| 281 | regular_key.press(); | 281 | regular_key.press(); |
| 282 | run_one_scan_loop(); | 282 | run_one_scan_loop(); |
| 283 | EXPECT_TRUE(layer_state_is(1)); | 283 | EXPECT_TRUE(layer_state_is(1)); |
| 284 | testing::Mock::VerifyAndClearExpectations(&driver); | 284 | VERIFY_AND_CLEAR(driver); |
| 285 | 285 | ||
| 286 | EXPECT_EMPTY_REPORT(driver); | 286 | EXPECT_EMPTY_REPORT(driver); |
| 287 | regular_key.release(); | 287 | regular_key.release(); |
| 288 | run_one_scan_loop(); | 288 | run_one_scan_loop(); |
| 289 | EXPECT_TRUE(layer_state_is(1)); | 289 | EXPECT_TRUE(layer_state_is(1)); |
| 290 | testing::Mock::VerifyAndClearExpectations(&driver); | 290 | VERIFY_AND_CLEAR(driver); |
| 291 | 291 | ||
| 292 | EXPECT_NO_REPORT(driver); | 292 | EXPECT_NO_REPORT(driver); |
| 293 | layer_key.release(); | 293 | layer_key.release(); |
| 294 | run_one_scan_loop(); | 294 | run_one_scan_loop(); |
| 295 | EXPECT_TRUE(layer_state_is(0)); | 295 | EXPECT_TRUE(layer_state_is(0)); |
| 296 | testing::Mock::VerifyAndClearExpectations(&driver); | 296 | VERIFY_AND_CLEAR(driver); |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { | 299 | TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { |
| @@ -344,19 +344,19 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) { | |||
| 344 | run_one_scan_loop(); | 344 | run_one_scan_loop(); |
| 345 | EXPECT_TRUE(layer_state_is(1)); | 345 | EXPECT_TRUE(layer_state_is(1)); |
| 346 | 346 | ||
| 347 | testing::Mock::VerifyAndClearExpectations(&driver); | 347 | VERIFY_AND_CLEAR(driver); |
| 348 | 348 | ||
| 349 | EXPECT_REPORT(driver, (KC_B)).Times(1); | 349 | EXPECT_REPORT(driver, (KC_B)).Times(1); |
| 350 | regular_key.press(); | 350 | regular_key.press(); |
| 351 | run_one_scan_loop(); | 351 | run_one_scan_loop(); |
| 352 | EXPECT_TRUE(layer_state_is(1)); | 352 | EXPECT_TRUE(layer_state_is(1)); |
| 353 | testing::Mock::VerifyAndClearExpectations(&driver); | 353 | VERIFY_AND_CLEAR(driver); |
| 354 | 354 | ||
| 355 | EXPECT_EMPTY_REPORT(driver); | 355 | EXPECT_EMPTY_REPORT(driver); |
| 356 | regular_key.release(); | 356 | regular_key.release(); |
| 357 | run_one_scan_loop(); | 357 | run_one_scan_loop(); |
| 358 | EXPECT_TRUE(layer_state_is(1)); | 358 | EXPECT_TRUE(layer_state_is(1)); |
| 359 | testing::Mock::VerifyAndClearExpectations(&driver); | 359 | VERIFY_AND_CLEAR(driver); |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { | 362 | TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { |
| @@ -373,7 +373,7 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { | |||
| 373 | layer_0_key_0.press(); | 373 | layer_0_key_0.press(); |
| 374 | idle_for(TAPPING_TERM); | 374 | idle_for(TAPPING_TERM); |
| 375 | EXPECT_TRUE(layer_state_is(0)); | 375 | EXPECT_TRUE(layer_state_is(0)); |
| 376 | testing::Mock::VerifyAndClearExpectations(&driver); | 376 | VERIFY_AND_CLEAR(driver); |
| 377 | 377 | ||
| 378 | /* Press key with layer 1 mapping, result basically expected | 378 | /* Press key with layer 1 mapping, result basically expected |
| 379 | * altough more reports are send then necessary. */ | 379 | * altough more reports are send then necessary. */ |
| @@ -382,14 +382,14 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { | |||
| 382 | layer_1_key_1.press(); | 382 | layer_1_key_1.press(); |
| 383 | run_one_scan_loop(); | 383 | run_one_scan_loop(); |
| 384 | EXPECT_TRUE(layer_state_is(1)); | 384 | EXPECT_TRUE(layer_state_is(1)); |
| 385 | testing::Mock::VerifyAndClearExpectations(&driver); | 385 | VERIFY_AND_CLEAR(driver); |
| 386 | 386 | ||
| 387 | /* Release layer tap key, no report is send because key is still held. */ | 387 | /* Release layer tap key, no report is send because key is still held. */ |
| 388 | EXPECT_NO_REPORT(driver); | 388 | EXPECT_NO_REPORT(driver); |
| 389 | layer_0_key_0.release(); | 389 | layer_0_key_0.release(); |
| 390 | run_one_scan_loop(); | 390 | run_one_scan_loop(); |
| 391 | EXPECT_TRUE(layer_state_is(0)); | 391 | EXPECT_TRUE(layer_state_is(0)); |
| 392 | testing::Mock::VerifyAndClearExpectations(&driver); | 392 | VERIFY_AND_CLEAR(driver); |
| 393 | 393 | ||
| 394 | /* Unregister keycode and modifier. */ | 394 | /* Unregister keycode and modifier. */ |
| 395 | EXPECT_REPORT(driver, (KC_RALT)).Times(1); | 395 | EXPECT_REPORT(driver, (KC_RALT)).Times(1); |
| @@ -397,5 +397,5 @@ TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) { | |||
| 397 | layer_1_key_1.release(); | 397 | layer_1_key_1.release(); |
| 398 | run_one_scan_loop(); | 398 | run_one_scan_loop(); |
| 399 | EXPECT_TRUE(layer_state_is(0)); | 399 | EXPECT_TRUE(layer_state_is(0)); |
| 400 | testing::Mock::VerifyAndClearExpectations(&driver); | 400 | VERIFY_AND_CLEAR(driver); |
| 401 | } | 401 | } |
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) { | |||
| 175 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 175 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 176 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); | 176 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); |
| 177 | run_one_scan_loop(); | 177 | run_one_scan_loop(); |
| 178 | testing::Mock::VerifyAndClearExpectations(&driver); | 178 | VERIFY_AND_CLEAR(driver); |
| 179 | 179 | ||
| 180 | key_plus.release(); | 180 | key_plus.release(); |
| 181 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 181 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 182 | EXPECT_EMPTY_REPORT(driver); | 182 | EXPECT_EMPTY_REPORT(driver); |
| 183 | run_one_scan_loop(); | 183 | run_one_scan_loop(); |
| 184 | testing::Mock::VerifyAndClearExpectations(&driver); | 184 | VERIFY_AND_CLEAR(driver); |
| 185 | 185 | ||
| 186 | key_eql.press(); | 186 | key_eql.press(); |
| 187 | EXPECT_REPORT(driver, (key_eql.report_code)); | 187 | EXPECT_REPORT(driver, (key_eql.report_code)); |
| 188 | run_one_scan_loop(); | 188 | run_one_scan_loop(); |
| 189 | testing::Mock::VerifyAndClearExpectations(&driver); | 189 | VERIFY_AND_CLEAR(driver); |
| 190 | 190 | ||
| 191 | key_eql.release(); | 191 | key_eql.release(); |
| 192 | EXPECT_EMPTY_REPORT(driver); | 192 | EXPECT_EMPTY_REPORT(driver); |
| 193 | run_one_scan_loop(); | 193 | run_one_scan_loop(); |
| 194 | testing::Mock::VerifyAndClearExpectations(&driver); | 194 | VERIFY_AND_CLEAR(driver); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { | 197 | TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { |
| @@ -206,24 +206,24 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { | |||
| 206 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 206 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 207 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); | 207 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); |
| 208 | run_one_scan_loop(); | 208 | run_one_scan_loop(); |
| 209 | testing::Mock::VerifyAndClearExpectations(&driver); | 209 | VERIFY_AND_CLEAR(driver); |
| 210 | 210 | ||
| 211 | key_eql.press(); | 211 | key_eql.press(); |
| 212 | EXPECT_EMPTY_REPORT(driver); | 212 | EXPECT_EMPTY_REPORT(driver); |
| 213 | EXPECT_REPORT(driver, (KC_EQUAL)); | 213 | EXPECT_REPORT(driver, (KC_EQUAL)); |
| 214 | run_one_scan_loop(); | 214 | run_one_scan_loop(); |
| 215 | testing::Mock::VerifyAndClearExpectations(&driver); | 215 | VERIFY_AND_CLEAR(driver); |
| 216 | 216 | ||
| 217 | key_plus.release(); | 217 | key_plus.release(); |
| 218 | // BUG: Should really still return KC_EQUAL, but this is fine too | 218 | // BUG: Should really still return KC_EQUAL, but this is fine too |
| 219 | EXPECT_EMPTY_REPORT(driver); | 219 | EXPECT_EMPTY_REPORT(driver); |
| 220 | run_one_scan_loop(); | 220 | run_one_scan_loop(); |
| 221 | testing::Mock::VerifyAndClearExpectations(&driver); | 221 | VERIFY_AND_CLEAR(driver); |
| 222 | 222 | ||
| 223 | key_eql.release(); | 223 | key_eql.release(); |
| 224 | EXPECT_NO_REPORT(driver); | 224 | EXPECT_NO_REPORT(driver); |
| 225 | run_one_scan_loop(); | 225 | run_one_scan_loop(); |
| 226 | testing::Mock::VerifyAndClearExpectations(&driver); | 226 | VERIFY_AND_CLEAR(driver); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { | 229 | TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { |
| @@ -237,24 +237,24 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { | |||
| 237 | key_eql.press(); | 237 | key_eql.press(); |
| 238 | EXPECT_REPORT(driver, (KC_EQUAL)); | 238 | EXPECT_REPORT(driver, (KC_EQUAL)); |
| 239 | run_one_scan_loop(); | 239 | run_one_scan_loop(); |
| 240 | testing::Mock::VerifyAndClearExpectations(&driver); | 240 | VERIFY_AND_CLEAR(driver); |
| 241 | 241 | ||
| 242 | key_eql.release(); | 242 | key_eql.release(); |
| 243 | EXPECT_EMPTY_REPORT(driver); | 243 | EXPECT_EMPTY_REPORT(driver); |
| 244 | run_one_scan_loop(); | 244 | run_one_scan_loop(); |
| 245 | testing::Mock::VerifyAndClearExpectations(&driver); | 245 | VERIFY_AND_CLEAR(driver); |
| 246 | 246 | ||
| 247 | key_plus.press(); | 247 | key_plus.press(); |
| 248 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 248 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 249 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); | 249 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); |
| 250 | run_one_scan_loop(); | 250 | run_one_scan_loop(); |
| 251 | testing::Mock::VerifyAndClearExpectations(&driver); | 251 | VERIFY_AND_CLEAR(driver); |
| 252 | 252 | ||
| 253 | key_plus.release(); | 253 | key_plus.release(); |
| 254 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 254 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 255 | EXPECT_EMPTY_REPORT(driver); | 255 | EXPECT_EMPTY_REPORT(driver); |
| 256 | run_one_scan_loop(); | 256 | run_one_scan_loop(); |
| 257 | testing::Mock::VerifyAndClearExpectations(&driver); | 257 | VERIFY_AND_CLEAR(driver); |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { | 260 | TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { |
| @@ -268,7 +268,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { | |||
| 268 | key_eql.press(); | 268 | key_eql.press(); |
| 269 | EXPECT_REPORT(driver, (KC_EQUAL)); | 269 | EXPECT_REPORT(driver, (KC_EQUAL)); |
| 270 | run_one_scan_loop(); | 270 | run_one_scan_loop(); |
| 271 | testing::Mock::VerifyAndClearExpectations(&driver); | 271 | VERIFY_AND_CLEAR(driver); |
| 272 | 272 | ||
| 273 | key_plus.press(); | 273 | key_plus.press(); |
| 274 | // BUG: The sequence is a bit strange, but it works, the end result is that | 274 | // BUG: The sequence is a bit strange, but it works, the end result is that |
| @@ -277,16 +277,16 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { | |||
| 277 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 277 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 278 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); | 278 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); |
| 279 | run_one_scan_loop(); | 279 | run_one_scan_loop(); |
| 280 | testing::Mock::VerifyAndClearExpectations(&driver); | 280 | VERIFY_AND_CLEAR(driver); |
| 281 | 281 | ||
| 282 | key_eql.release(); | 282 | key_eql.release(); |
| 283 | // I guess it's fine to still report shift here | 283 | // I guess it's fine to still report shift here |
| 284 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 284 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 285 | run_one_scan_loop(); | 285 | run_one_scan_loop(); |
| 286 | testing::Mock::VerifyAndClearExpectations(&driver); | 286 | VERIFY_AND_CLEAR(driver); |
| 287 | 287 | ||
| 288 | key_plus.release(); | 288 | key_plus.release(); |
| 289 | EXPECT_EMPTY_REPORT(driver); | 289 | EXPECT_EMPTY_REPORT(driver); |
| 290 | run_one_scan_loop(); | 290 | run_one_scan_loop(); |
| 291 | testing::Mock::VerifyAndClearExpectations(&driver); | 291 | VERIFY_AND_CLEAR(driver); |
| 292 | } | 292 | } |
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) { | |||
| 36 | run_one_scan_loop(); | 36 | run_one_scan_loop(); |
| 37 | osm_key.release(); | 37 | osm_key.release(); |
| 38 | run_one_scan_loop(); | 38 | run_one_scan_loop(); |
| 39 | testing::Mock::VerifyAndClearExpectations(&driver); | 39 | VERIFY_AND_CLEAR(driver); |
| 40 | 40 | ||
| 41 | /* OSM are added when an actual report is send */ | 41 | /* OSM are added when an actual report is send */ |
| 42 | EXPECT_REPORT(driver, (osm_key.report_code)); | 42 | EXPECT_REPORT(driver, (osm_key.report_code)); |
| 43 | send_keyboard_report(); | 43 | send_keyboard_report(); |
| 44 | testing::Mock::VerifyAndClearExpectations(&driver); | 44 | VERIFY_AND_CLEAR(driver); |
| 45 | 45 | ||
| 46 | /* Make unit-test pass */ | 46 | /* Make unit-test pass */ |
| 47 | clear_oneshot_mods(); | 47 | clear_oneshot_mods(); |
| @@ -62,19 +62,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMExpiredDoesNothing) { | |||
| 62 | run_one_scan_loop(); | 62 | run_one_scan_loop(); |
| 63 | osm_key.release(); | 63 | osm_key.release(); |
| 64 | idle_for(ONESHOT_TIMEOUT); | 64 | idle_for(ONESHOT_TIMEOUT); |
| 65 | testing::Mock::VerifyAndClearExpectations(&driver); | 65 | VERIFY_AND_CLEAR(driver); |
| 66 | 66 | ||
| 67 | /* Press regular key */ | 67 | /* Press regular key */ |
| 68 | EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); | 68 | EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); |
| 69 | regular_key.press(); | 69 | regular_key.press(); |
| 70 | run_one_scan_loop(); | 70 | run_one_scan_loop(); |
| 71 | testing::Mock::VerifyAndClearExpectations(&driver); | 71 | VERIFY_AND_CLEAR(driver); |
| 72 | 72 | ||
| 73 | /* Release regular key */ | 73 | /* Release regular key */ |
| 74 | EXPECT_EMPTY_REPORT(driver); | 74 | EXPECT_EMPTY_REPORT(driver); |
| 75 | regular_key.release(); | 75 | regular_key.release(); |
| 76 | run_one_scan_loop(); | 76 | run_one_scan_loop(); |
| 77 | testing::Mock::VerifyAndClearExpectations(&driver); | 77 | VERIFY_AND_CLEAR(driver); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | #endif | 80 | #endif |
| @@ -92,19 +92,19 @@ TEST_P(OneShotParametrizedTestFixture, OSMWithAdditionalKeypress) { | |||
| 92 | run_one_scan_loop(); | 92 | run_one_scan_loop(); |
| 93 | osm_key.release(); | 93 | osm_key.release(); |
| 94 | run_one_scan_loop(); | 94 | run_one_scan_loop(); |
| 95 | testing::Mock::VerifyAndClearExpectations(&driver); | 95 | VERIFY_AND_CLEAR(driver); |
| 96 | 96 | ||
| 97 | /* Press regular key */ | 97 | /* Press regular key */ |
| 98 | EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)).Times(1); | 98 | EXPECT_REPORT(driver, (osm_key.report_code, regular_key.report_code)).Times(1); |
| 99 | regular_key.press(); | 99 | regular_key.press(); |
| 100 | run_one_scan_loop(); | 100 | run_one_scan_loop(); |
| 101 | testing::Mock::VerifyAndClearExpectations(&driver); | 101 | VERIFY_AND_CLEAR(driver); |
| 102 | 102 | ||
| 103 | /* Release regular key */ | 103 | /* Release regular key */ |
| 104 | EXPECT_EMPTY_REPORT(driver); | 104 | EXPECT_EMPTY_REPORT(driver); |
| 105 | regular_key.release(); | 105 | regular_key.release(); |
| 106 | run_one_scan_loop(); | 106 | run_one_scan_loop(); |
| 107 | testing::Mock::VerifyAndClearExpectations(&driver); | 107 | VERIFY_AND_CLEAR(driver); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { | 110 | TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypress) { |
| @@ -120,26 +120,26 @@ TEST_P(OneShotParametrizedTestFixture, OSMAsRegularModifierWithAdditionalKeypres | |||
| 120 | EXPECT_NO_REPORT(driver); | 120 | EXPECT_NO_REPORT(driver); |
| 121 | osm_key.press(); | 121 | osm_key.press(); |
| 122 | run_one_scan_loop(); | 122 | run_one_scan_loop(); |
| 123 | testing::Mock::VerifyAndClearExpectations(&driver); | 123 | VERIFY_AND_CLEAR(driver); |
| 124 | 124 | ||
| 125 | /* Press regular key */ | 125 | /* Press regular key */ |
| 126 | EXPECT_NO_REPORT(driver); | 126 | EXPECT_NO_REPORT(driver); |
| 127 | regular_key.press(); | 127 | regular_key.press(); |
| 128 | run_one_scan_loop(); | 128 | run_one_scan_loop(); |
| 129 | testing::Mock::VerifyAndClearExpectations(&driver); | 129 | VERIFY_AND_CLEAR(driver); |
| 130 | 130 | ||
| 131 | /* Release regular key */ | 131 | /* Release regular key */ |
| 132 | EXPECT_NO_REPORT(driver); | 132 | EXPECT_NO_REPORT(driver); |
| 133 | regular_key.release(); | 133 | regular_key.release(); |
| 134 | run_one_scan_loop(); | 134 | run_one_scan_loop(); |
| 135 | testing::Mock::VerifyAndClearExpectations(&driver); | 135 | VERIFY_AND_CLEAR(driver); |
| 136 | 136 | ||
| 137 | /* Release OSM */ | 137 | /* Release OSM */ |
| 138 | EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); | 138 | EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); |
| 139 | EXPECT_EMPTY_REPORT(driver); | 139 | EXPECT_EMPTY_REPORT(driver); |
| 140 | osm_key.release(); | 140 | osm_key.release(); |
| 141 | run_one_scan_loop(); | 141 | run_one_scan_loop(); |
| 142 | testing::Mock::VerifyAndClearExpectations(&driver); | 142 | VERIFY_AND_CLEAR(driver); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | // clang-format off | 145 | // clang-format off |
| @@ -172,24 +172,24 @@ TEST_F(OneShot, OSLWithAdditionalKeypress) { | |||
| 172 | EXPECT_NO_REPORT(driver); | 172 | EXPECT_NO_REPORT(driver); |
| 173 | osl_key.press(); | 173 | osl_key.press(); |
| 174 | run_one_scan_loop(); | 174 | run_one_scan_loop(); |
| 175 | testing::Mock::VerifyAndClearExpectations(&driver); | 175 | VERIFY_AND_CLEAR(driver); |
| 176 | 176 | ||
| 177 | /* Release OSL key */ | 177 | /* Release OSL key */ |
| 178 | EXPECT_NO_REPORT(driver); | 178 | EXPECT_NO_REPORT(driver); |
| 179 | osl_key.release(); | 179 | osl_key.release(); |
| 180 | run_one_scan_loop(); | 180 | run_one_scan_loop(); |
| 181 | testing::Mock::VerifyAndClearExpectations(&driver); | 181 | VERIFY_AND_CLEAR(driver); |
| 182 | 182 | ||
| 183 | /* Press regular key */ | 183 | /* Press regular key */ |
| 184 | EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); | 184 | EXPECT_REPORT(driver, (regular_key.report_code)).Times(1); |
| 185 | EXPECT_EMPTY_REPORT(driver); | 185 | EXPECT_EMPTY_REPORT(driver); |
| 186 | regular_key.press(); | 186 | regular_key.press(); |
| 187 | run_one_scan_loop(); | 187 | run_one_scan_loop(); |
| 188 | testing::Mock::VerifyAndClearExpectations(&driver); | 188 | VERIFY_AND_CLEAR(driver); |
| 189 | 189 | ||
| 190 | /* Release regular key */ | 190 | /* Release regular key */ |
| 191 | EXPECT_NO_REPORT(driver); | 191 | EXPECT_NO_REPORT(driver); |
| 192 | regular_key.release(); | 192 | regular_key.release(); |
| 193 | run_one_scan_loop(); | 193 | run_one_scan_loop(); |
| 194 | testing::Mock::VerifyAndClearExpectations(&driver); | 194 | VERIFY_AND_CLEAR(driver); |
| 195 | } | 195 | } |
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 | } |
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) { | |||
| 64 | tap_key(key_spc); | 64 | tap_key(key_spc); |
| 65 | tap_key(key_a); | 65 | tap_key(key_a); |
| 66 | 66 | ||
| 67 | testing::Mock::VerifyAndClearExpectations(&driver); | 67 | VERIFY_AND_CLEAR(driver); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | // Test Caps Word + Auto Shift where keys A and B are rolled. | 70 | // Test Caps Word + Auto Shift where keys A and B are rolled. |
| @@ -104,7 +104,7 @@ TEST_F(CapsWord, AutoShiftRolledShiftedKeys) { | |||
| 104 | run_one_scan_loop(); | 104 | run_one_scan_loop(); |
| 105 | 105 | ||
| 106 | caps_word_off(); | 106 | caps_word_off(); |
| 107 | testing::Mock::VerifyAndClearExpectations(&driver); | 107 | VERIFY_AND_CLEAR(driver); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | // Tests that with tap-hold keys with Retro Shift, letter keys are shifted by | 110 | // Tests that with tap-hold keys with Retro Shift, letter keys are shifted by |
| @@ -133,5 +133,5 @@ TEST_F(CapsWord, RetroShiftKeys) { | |||
| 133 | tap_key(key_modtap_a); // Tap A quickly. | 133 | tap_key(key_modtap_a); // Tap A quickly. |
| 134 | 134 | ||
| 135 | EXPECT_EQ(is_caps_word_on(), true); | 135 | EXPECT_EQ(is_caps_word_on(), true); |
| 136 | testing::Mock::VerifyAndClearExpectations(&driver); | 136 | VERIFY_AND_CLEAR(driver); |
| 137 | } | 137 | } |
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) { | |||
| 102 | EXPECT_TRUE(is_caps_word_on()); | 102 | EXPECT_TRUE(is_caps_word_on()); |
| 103 | caps_word_off(); | 103 | caps_word_off(); |
| 104 | 104 | ||
| 105 | testing::Mock::VerifyAndClearExpectations(&driver); | 105 | VERIFY_AND_CLEAR(driver); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | // Test a longer 4-key combo. | 108 | // Test a longer 4-key combo. |
| @@ -123,7 +123,7 @@ TEST_P(CapsWord, LongerCombo) { | |||
| 123 | EXPECT_TRUE(is_caps_word_on()); | 123 | EXPECT_TRUE(is_caps_word_on()); |
| 124 | caps_word_off(); | 124 | caps_word_off(); |
| 125 | 125 | ||
| 126 | testing::Mock::VerifyAndClearExpectations(&driver); | 126 | VERIFY_AND_CLEAR(driver); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | // Test with two overlapping combos on regular keys: | 129 | // Test with two overlapping combos on regular keys: |
| @@ -161,7 +161,7 @@ TEST_P(CapsWord, ComboRegularKeys) { | |||
| 161 | tap_key(key_a); | 161 | tap_key(key_a); |
| 162 | 162 | ||
| 163 | EXPECT_FALSE(is_caps_word_on()); | 163 | EXPECT_FALSE(is_caps_word_on()); |
| 164 | testing::Mock::VerifyAndClearExpectations(&driver); | 164 | VERIFY_AND_CLEAR(driver); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | // Test where combo chords involve tap-hold keys: | 167 | // Test where combo chords involve tap-hold keys: |
| @@ -194,7 +194,7 @@ TEST_P(CapsWord, ComboModTapKey) { | |||
| 194 | EXPECT_TRUE(is_caps_word_on()); | 194 | EXPECT_TRUE(is_caps_word_on()); |
| 195 | caps_word_off(); | 195 | caps_word_off(); |
| 196 | 196 | ||
| 197 | testing::Mock::VerifyAndClearExpectations(&driver); | 197 | VERIFY_AND_CLEAR(driver); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | // clang-format off | 200 | // 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) { | |||
| 93 | tap_keys(key_delta, key_spc, key_delta); | 93 | tap_keys(key_delta, key_spc, key_delta); |
| 94 | 94 | ||
| 95 | EXPECT_EQ(is_caps_word_on(), false); | 95 | EXPECT_EQ(is_caps_word_on(), false); |
| 96 | testing::Mock::VerifyAndClearExpectations(&driver); | 96 | VERIFY_AND_CLEAR(driver); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | // Tests typing U_ENDASH while Caps Word is on. | 99 | // Tests typing U_ENDASH while Caps Word is on. |
| @@ -117,5 +117,5 @@ TEST_F(CapsWord, UnshiftedUnicodeMapKey) { | |||
| 117 | tap_key(key_dash); | 117 | tap_key(key_dash); |
| 118 | 118 | ||
| 119 | EXPECT_EQ(is_caps_word_on(), true); | 119 | EXPECT_EQ(is_caps_word_on(), true); |
| 120 | testing::Mock::VerifyAndClearExpectations(&driver); | 120 | VERIFY_AND_CLEAR(driver); |
| 121 | } | 121 | } |
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) { | |||
| 90 | caps_word_toggle(); | 90 | caps_word_toggle(); |
| 91 | EXPECT_EQ(is_caps_word_on(), false); | 91 | EXPECT_EQ(is_caps_word_on(), false); |
| 92 | 92 | ||
| 93 | testing::Mock::VerifyAndClearExpectations(&driver); | 93 | VERIFY_AND_CLEAR(driver); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | // Tests the default `caps_word_press_user()` function. | 96 | // Tests the default `caps_word_press_user()` function. |
| @@ -133,7 +133,7 @@ TEST_F(CapsWord, CapswrdKey) { | |||
| 133 | tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key again. | 133 | tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key again. |
| 134 | EXPECT_EQ(is_caps_word_on(), false); | 134 | EXPECT_EQ(is_caps_word_on(), false); |
| 135 | 135 | ||
| 136 | testing::Mock::VerifyAndClearExpectations(&driver); | 136 | VERIFY_AND_CLEAR(driver); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | // Tests that being idle for CAPS_WORD_IDLE_TIMEOUT turns off Caps Word. | 139 | // Tests that being idle for CAPS_WORD_IDLE_TIMEOUT turns off Caps Word. |
| @@ -157,7 +157,7 @@ TEST_F(CapsWord, IdleTimeout) { | |||
| 157 | caps_word_on(); | 157 | caps_word_on(); |
| 158 | tap_key(key_a); | 158 | tap_key(key_a); |
| 159 | 159 | ||
| 160 | testing::Mock::VerifyAndClearExpectations(&driver); | 160 | VERIFY_AND_CLEAR(driver); |
| 161 | 161 | ||
| 162 | idle_for(CAPS_WORD_IDLE_TIMEOUT); | 162 | idle_for(CAPS_WORD_IDLE_TIMEOUT); |
| 163 | run_one_scan_loop(); | 163 | run_one_scan_loop(); |
| @@ -171,7 +171,7 @@ TEST_F(CapsWord, IdleTimeout) { | |||
| 171 | EXPECT_REPORT(driver, (KC_A)); | 171 | EXPECT_REPORT(driver, (KC_A)); |
| 172 | tap_key(key_a); | 172 | tap_key(key_a); |
| 173 | 173 | ||
| 174 | testing::Mock::VerifyAndClearExpectations(&driver); | 174 | VERIFY_AND_CLEAR(driver); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | // Tests that typing "A, 4, A, 4" produces "Shift+A, 4, Shift+A, 4". | 177 | // Tests that typing "A, 4, A, 4" produces "Shift+A, 4, Shift+A, 4". |
| @@ -201,7 +201,7 @@ TEST_F(CapsWord, ShiftsLettersButNotDigits) { | |||
| 201 | caps_word_on(); | 201 | caps_word_on(); |
| 202 | tap_keys(key_a, key_4, key_a, key_4); | 202 | tap_keys(key_a, key_4, key_a, key_4); |
| 203 | 203 | ||
| 204 | testing::Mock::VerifyAndClearExpectations(&driver); | 204 | VERIFY_AND_CLEAR(driver); |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | // Tests that typing "A, Space, A" produces "Shift+A, Space, A". | 207 | // Tests that typing "A, Space, A" produces "Shift+A, Space, A". |
| @@ -230,7 +230,7 @@ TEST_F(CapsWord, SpaceTurnsOffCapsWord) { | |||
| 230 | caps_word_on(); | 230 | caps_word_on(); |
| 231 | tap_keys(key_a, key_spc, key_a); | 231 | tap_keys(key_a, key_spc, key_a); |
| 232 | 232 | ||
| 233 | testing::Mock::VerifyAndClearExpectations(&driver); | 233 | VERIFY_AND_CLEAR(driver); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | // Tests that typing "AltGr + A" produces "Shift + AltGr + A". | 236 | // Tests that typing "AltGr + A" produces "Shift + AltGr + A". |
| @@ -260,7 +260,7 @@ TEST_F(CapsWord, ShiftsAltGrSymbols) { | |||
| 260 | run_one_scan_loop(); | 260 | run_one_scan_loop(); |
| 261 | key_altgr.release(); | 261 | key_altgr.release(); |
| 262 | 262 | ||
| 263 | testing::Mock::VerifyAndClearExpectations(&driver); | 263 | VERIFY_AND_CLEAR(driver); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | // Tests typing "AltGr + A" using a mod-tap key. | 266 | // Tests typing "AltGr + A" using a mod-tap key. |
| @@ -291,7 +291,7 @@ TEST_F(CapsWord, ShiftsModTapAltGrSymbols) { | |||
| 291 | key_altgr_t.release(); | 291 | key_altgr_t.release(); |
| 292 | 292 | ||
| 293 | EXPECT_TRUE(is_caps_word_on()); | 293 | EXPECT_TRUE(is_caps_word_on()); |
| 294 | testing::Mock::VerifyAndClearExpectations(&driver); | 294 | VERIFY_AND_CLEAR(driver); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | struct CapsWordPressUserParams { | 297 | struct CapsWordPressUserParams { |
| @@ -326,7 +326,7 @@ TEST_P(CapsWordPressUser, KeyCode) { | |||
| 326 | EXPECT_EQ(passed_keycode, GetParam().expected_passed_keycode); | 326 | EXPECT_EQ(passed_keycode, GetParam().expected_passed_keycode); |
| 327 | EXPECT_EQ(is_caps_word_on(), GetParam().continues_caps_word); | 327 | EXPECT_EQ(is_caps_word_on(), GetParam().continues_caps_word); |
| 328 | clear_oneshot_mods(); | 328 | clear_oneshot_mods(); |
| 329 | testing::Mock::VerifyAndClearExpectations(&driver); | 329 | VERIFY_AND_CLEAR(driver); |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | const uint16_t LT_1_KC_A = LT(1, KC_A); | 332 | const uint16_t LT_1_KC_A = LT(1, KC_A); |
| @@ -431,7 +431,7 @@ TEST_P(CapsWordBothShifts, PressLRLR) { | |||
| 431 | 431 | ||
| 432 | EXPECT_EQ(is_caps_word_on(), true); | 432 | EXPECT_EQ(is_caps_word_on(), true); |
| 433 | 433 | ||
| 434 | testing::Mock::VerifyAndClearExpectations(&driver); | 434 | VERIFY_AND_CLEAR(driver); |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | // Pressing shifts as "Left down, Right down, Right up, Left up". | 437 | // Pressing shifts as "Left down, Right down, Right up, Left up". |
| @@ -468,7 +468,7 @@ TEST_P(CapsWordBothShifts, PressLRRL) { | |||
| 468 | 468 | ||
| 469 | EXPECT_EQ(is_caps_word_on(), true); | 469 | EXPECT_EQ(is_caps_word_on(), true); |
| 470 | 470 | ||
| 471 | testing::Mock::VerifyAndClearExpectations(&driver); | 471 | VERIFY_AND_CLEAR(driver); |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | // clang-format off | 474 | // clang-format off |
| @@ -524,7 +524,7 @@ TEST_P(CapsWordDoubleTapShift, Activation) { | |||
| 524 | 524 | ||
| 525 | EXPECT_EQ(is_caps_word_on(), true); | 525 | EXPECT_EQ(is_caps_word_on(), true); |
| 526 | 526 | ||
| 527 | testing::Mock::VerifyAndClearExpectations(&driver); | 527 | VERIFY_AND_CLEAR(driver); |
| 528 | 528 | ||
| 529 | // We have to manually reset the internal state of the caps word state | 529 | // We have to manually reset the internal state of the caps word state |
| 530 | // machine at this point. This due to imperfect test isolation which can't | 530 | // machine at this point. This due to imperfect test isolation which can't |
| @@ -562,7 +562,7 @@ TEST_P(CapsWordDoubleTapShift, Interrupted) { | |||
| 562 | EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. | 562 | EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. |
| 563 | clear_oneshot_mods(); | 563 | clear_oneshot_mods(); |
| 564 | 564 | ||
| 565 | testing::Mock::VerifyAndClearExpectations(&driver); | 565 | VERIFY_AND_CLEAR(driver); |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | // Double tap doesn't count if taps are more than tapping term apart. | 568 | // Double tap doesn't count if taps are more than tapping term apart. |
| @@ -585,7 +585,7 @@ TEST_P(CapsWordDoubleTapShift, SlowTaps) { | |||
| 585 | EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. | 585 | EXPECT_EQ(is_caps_word_on(), false); // Caps Word is still off. |
| 586 | clear_oneshot_mods(); | 586 | clear_oneshot_mods(); |
| 587 | 587 | ||
| 588 | testing::Mock::VerifyAndClearExpectations(&driver); | 588 | VERIFY_AND_CLEAR(driver); |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | // clang-format off | 591 | // clang-format off |
| @@ -623,7 +623,7 @@ TEST_F(CapsWord, IgnoresOSLHold) { | |||
| 623 | key_osl.release(); | 623 | key_osl.release(); |
| 624 | run_one_scan_loop(); | 624 | run_one_scan_loop(); |
| 625 | 625 | ||
| 626 | testing::Mock::VerifyAndClearExpectations(&driver); | 626 | VERIFY_AND_CLEAR(driver); |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | // Tests that tapping a OSL keeps caps word active and shifts keys on the layer that need to be shifted. | 629 | // Tests that tapping a OSL keeps caps word active and shifts keys on the layer that need to be shifted. |
| @@ -648,7 +648,7 @@ TEST_F(CapsWord, IgnoresOSLTap) { | |||
| 648 | tap_key(key_b); | 648 | tap_key(key_b); |
| 649 | run_one_scan_loop(); | 649 | run_one_scan_loop(); |
| 650 | 650 | ||
| 651 | testing::Mock::VerifyAndClearExpectations(&driver); | 651 | VERIFY_AND_CLEAR(driver); |
| 652 | } | 652 | } |
| 653 | // clang-format on | 653 | // clang-format on |
| 654 | } // namespace | 654 | } // namespace |
diff --git a/tests/secure/test_secure.cpp b/tests/secure/test_secure.cpp index 6ca98d78f3..3162e9d5df 100644 --- a/tests/secure/test_secure.cpp +++ b/tests/secure/test_secure.cpp | |||
| @@ -43,7 +43,7 @@ TEST_F(Secure, test_lock) { | |||
| 43 | secure_lock(); | 43 | secure_lock(); |
| 44 | EXPECT_FALSE(secure_is_unlocked()); | 44 | EXPECT_FALSE(secure_is_unlocked()); |
| 45 | 45 | ||
| 46 | testing::Mock::VerifyAndClearExpectations(&driver); | 46 | VERIFY_AND_CLEAR(driver); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | TEST_F(Secure, test_unlock_timeout) { | 49 | TEST_F(Secure, test_unlock_timeout) { |
| @@ -58,7 +58,7 @@ TEST_F(Secure, test_unlock_timeout) { | |||
| 58 | idle_for(SECURE_IDLE_TIMEOUT + 1); | 58 | idle_for(SECURE_IDLE_TIMEOUT + 1); |
| 59 | EXPECT_FALSE(secure_is_unlocked()); | 59 | EXPECT_FALSE(secure_is_unlocked()); |
| 60 | 60 | ||
| 61 | testing::Mock::VerifyAndClearExpectations(&driver); | 61 | VERIFY_AND_CLEAR(driver); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | TEST_F(Secure, test_unlock_request) { | 64 | TEST_F(Secure, test_unlock_request) { |
| @@ -80,7 +80,7 @@ TEST_F(Secure, test_unlock_request) { | |||
| 80 | tap_keys(key_a, key_b, key_c, key_d); | 80 | tap_keys(key_a, key_b, key_c, key_d); |
| 81 | EXPECT_TRUE(secure_is_unlocked()); | 81 | EXPECT_TRUE(secure_is_unlocked()); |
| 82 | 82 | ||
| 83 | testing::Mock::VerifyAndClearExpectations(&driver); | 83 | VERIFY_AND_CLEAR(driver); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | TEST_F(Secure, test_unlock_request_fail) { | 86 | TEST_F(Secure, test_unlock_request_fail) { |
| @@ -108,7 +108,7 @@ TEST_F(Secure, test_unlock_request_fail) { | |||
| 108 | tap_keys(key_e, key_a, key_b, key_c, key_d); | 108 | tap_keys(key_e, key_a, key_b, key_c, key_d); |
| 109 | EXPECT_FALSE(secure_is_unlocked()); | 109 | EXPECT_FALSE(secure_is_unlocked()); |
| 110 | 110 | ||
| 111 | testing::Mock::VerifyAndClearExpectations(&driver); | 111 | VERIFY_AND_CLEAR(driver); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | TEST_F(Secure, test_unlock_request_timeout) { | 114 | TEST_F(Secure, test_unlock_request_timeout) { |
| @@ -124,7 +124,7 @@ TEST_F(Secure, test_unlock_request_timeout) { | |||
| 124 | EXPECT_FALSE(secure_is_unlocking()); | 124 | EXPECT_FALSE(secure_is_unlocking()); |
| 125 | EXPECT_FALSE(secure_is_unlocked()); | 125 | EXPECT_FALSE(secure_is_unlocked()); |
| 126 | 126 | ||
| 127 | testing::Mock::VerifyAndClearExpectations(&driver); | 127 | VERIFY_AND_CLEAR(driver); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | TEST_F(Secure, test_unlock_request_fail_mid) { | 130 | TEST_F(Secure, test_unlock_request_fail_mid) { |
| @@ -151,7 +151,7 @@ TEST_F(Secure, test_unlock_request_fail_mid) { | |||
| 151 | EXPECT_FALSE(secure_is_unlocking()); | 151 | EXPECT_FALSE(secure_is_unlocking()); |
| 152 | EXPECT_FALSE(secure_is_unlocked()); | 152 | EXPECT_FALSE(secure_is_unlocked()); |
| 153 | 153 | ||
| 154 | testing::Mock::VerifyAndClearExpectations(&driver); | 154 | VERIFY_AND_CLEAR(driver); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | TEST_F(Secure, test_unlock_request_fail_out_of_order) { | 157 | TEST_F(Secure, test_unlock_request_fail_out_of_order) { |
| @@ -179,7 +179,7 @@ TEST_F(Secure, test_unlock_request_fail_out_of_order) { | |||
| 179 | EXPECT_FALSE(secure_is_unlocking()); | 179 | EXPECT_FALSE(secure_is_unlocking()); |
| 180 | EXPECT_FALSE(secure_is_unlocked()); | 180 | EXPECT_FALSE(secure_is_unlocked()); |
| 181 | 181 | ||
| 182 | testing::Mock::VerifyAndClearExpectations(&driver); | 182 | VERIFY_AND_CLEAR(driver); |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | TEST_F(Secure, test_unlock_request_on_layer) { | 185 | TEST_F(Secure, test_unlock_request_on_layer) { |
| @@ -206,7 +206,7 @@ TEST_F(Secure, test_unlock_request_on_layer) { | |||
| 206 | EXPECT_TRUE(secure_is_unlocked()); | 206 | EXPECT_TRUE(secure_is_unlocked()); |
| 207 | EXPECT_FALSE(layer_state_is(1)); | 207 | EXPECT_FALSE(layer_state_is(1)); |
| 208 | 208 | ||
| 209 | testing::Mock::VerifyAndClearExpectations(&driver); | 209 | VERIFY_AND_CLEAR(driver); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | TEST_F(Secure, test_unlock_request_mid_stroke) { | 212 | TEST_F(Secure, test_unlock_request_mid_stroke) { |
| @@ -231,7 +231,7 @@ TEST_F(Secure, test_unlock_request_mid_stroke) { | |||
| 231 | tap_keys(key_a, key_b, key_c, key_d); | 231 | tap_keys(key_a, key_b, key_c, key_d); |
| 232 | EXPECT_TRUE(secure_is_unlocked()); | 232 | EXPECT_TRUE(secure_is_unlocked()); |
| 233 | 233 | ||
| 234 | testing::Mock::VerifyAndClearExpectations(&driver); | 234 | VERIFY_AND_CLEAR(driver); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | TEST_F(Secure, test_unlock_request_mods) { | 237 | TEST_F(Secure, test_unlock_request_mods) { |
| @@ -256,5 +256,5 @@ TEST_F(Secure, test_unlock_request_mods) { | |||
| 256 | tap_keys(key_a, key_b, key_c, key_d); | 256 | tap_keys(key_a, key_b, key_c, key_d); |
| 257 | EXPECT_TRUE(secure_is_unlocked()); | 257 | EXPECT_TRUE(secure_is_unlocked()); |
| 258 | 258 | ||
| 259 | testing::Mock::VerifyAndClearExpectations(&driver); | 259 | VERIFY_AND_CLEAR(driver); |
| 260 | } | 260 | } |
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) { | |||
| 38 | EXPECT_NO_REPORT(driver); | 38 | EXPECT_NO_REPORT(driver); |
| 39 | mod_tap_hold_key.press(); | 39 | mod_tap_hold_key.press(); |
| 40 | run_one_scan_loop(); | 40 | run_one_scan_loop(); |
| 41 | testing::Mock::VerifyAndClearExpectations(&driver); | 41 | VERIFY_AND_CLEAR(driver); |
| 42 | 42 | ||
| 43 | /* Press regular key. */ | 43 | /* Press regular key. */ |
| 44 | EXPECT_NO_REPORT(driver); | 44 | EXPECT_NO_REPORT(driver); |
| 45 | regular_key.press(); | 45 | regular_key.press(); |
| 46 | run_one_scan_loop(); | 46 | run_one_scan_loop(); |
| 47 | testing::Mock::VerifyAndClearExpectations(&driver); | 47 | VERIFY_AND_CLEAR(driver); |
| 48 | 48 | ||
| 49 | /* Release regular key. */ | 49 | /* Release regular key. */ |
| 50 | EXPECT_NO_REPORT(driver); | 50 | EXPECT_NO_REPORT(driver); |
| 51 | regular_key.release(); | 51 | regular_key.release(); |
| 52 | run_one_scan_loop(); | 52 | run_one_scan_loop(); |
| 53 | testing::Mock::VerifyAndClearExpectations(&driver); | 53 | VERIFY_AND_CLEAR(driver); |
| 54 | 54 | ||
| 55 | /* Release mod-tap-hold key. */ | 55 | /* Release mod-tap-hold key. */ |
| 56 | EXPECT_REPORT(driver, (KC_P)); | 56 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -59,11 +59,11 @@ TEST_F(DefaultTapHold, tap_regular_key_while_mod_tap_key_is_held) { | |||
| 59 | EXPECT_EMPTY_REPORT(driver); | 59 | EXPECT_EMPTY_REPORT(driver); |
| 60 | mod_tap_hold_key.release(); | 60 | mod_tap_hold_key.release(); |
| 61 | run_one_scan_loop(); | 61 | run_one_scan_loop(); |
| 62 | testing::Mock::VerifyAndClearExpectations(&driver); | 62 | VERIFY_AND_CLEAR(driver); |
| 63 | 63 | ||
| 64 | /* Idle for tapping term of mod tap hold key. */ | 64 | /* Idle for tapping term of mod tap hold key. */ |
| 65 | idle_for(TAPPING_TERM - 3); | 65 | idle_for(TAPPING_TERM - 3); |
| 66 | testing::Mock::VerifyAndClearExpectations(&driver); | 66 | VERIFY_AND_CLEAR(driver); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { | 69 | 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) { | |||
| 78 | EXPECT_NO_REPORT(driver); | 78 | EXPECT_NO_REPORT(driver); |
| 79 | first_mod_tap_hold_key.press(); | 79 | first_mod_tap_hold_key.press(); |
| 80 | run_one_scan_loop(); | 80 | run_one_scan_loop(); |
| 81 | testing::Mock::VerifyAndClearExpectations(&driver); | 81 | VERIFY_AND_CLEAR(driver); |
| 82 | 82 | ||
| 83 | /* Press second tap-hold key */ | 83 | /* Press second tap-hold key */ |
| 84 | EXPECT_NO_REPORT(driver); | 84 | EXPECT_NO_REPORT(driver); |
| 85 | second_mod_tap_hold_key.press(); | 85 | second_mod_tap_hold_key.press(); |
| 86 | run_one_scan_loop(); | 86 | run_one_scan_loop(); |
| 87 | testing::Mock::VerifyAndClearExpectations(&driver); | 87 | VERIFY_AND_CLEAR(driver); |
| 88 | 88 | ||
| 89 | /* Release second tap-hold key */ | 89 | /* Release second tap-hold key */ |
| 90 | EXPECT_NO_REPORT(driver); | 90 | EXPECT_NO_REPORT(driver); |
| 91 | second_mod_tap_hold_key.release(); | 91 | second_mod_tap_hold_key.release(); |
| 92 | run_one_scan_loop(); | 92 | run_one_scan_loop(); |
| 93 | testing::Mock::VerifyAndClearExpectations(&driver); | 93 | VERIFY_AND_CLEAR(driver); |
| 94 | 94 | ||
| 95 | /* Release first mod-tap-hold key */ | 95 | /* Release first mod-tap-hold key */ |
| 96 | EXPECT_REPORT(driver, (KC_P)); | 96 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -99,7 +99,7 @@ TEST_F(DefaultTapHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { | |||
| 99 | EXPECT_EMPTY_REPORT(driver); | 99 | EXPECT_EMPTY_REPORT(driver); |
| 100 | first_mod_tap_hold_key.release(); | 100 | first_mod_tap_hold_key.release(); |
| 101 | run_one_scan_loop(); | 101 | run_one_scan_loop(); |
| 102 | testing::Mock::VerifyAndClearExpectations(&driver); | 102 | VERIFY_AND_CLEAR(driver); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { | 105 | 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) { | |||
| 115 | EXPECT_NO_REPORT(driver); | 115 | EXPECT_NO_REPORT(driver); |
| 116 | layer_tap_hold_key.press(); | 116 | layer_tap_hold_key.press(); |
| 117 | run_one_scan_loop(); | 117 | run_one_scan_loop(); |
| 118 | testing::Mock::VerifyAndClearExpectations(&driver); | 118 | VERIFY_AND_CLEAR(driver); |
| 119 | 119 | ||
| 120 | /* Press regular key */ | 120 | /* Press regular key */ |
| 121 | EXPECT_NO_REPORT(driver); | 121 | EXPECT_NO_REPORT(driver); |
| 122 | regular_key.press(); | 122 | regular_key.press(); |
| 123 | run_one_scan_loop(); | 123 | run_one_scan_loop(); |
| 124 | testing::Mock::VerifyAndClearExpectations(&driver); | 124 | VERIFY_AND_CLEAR(driver); |
| 125 | 125 | ||
| 126 | /* Release regular key */ | 126 | /* Release regular key */ |
| 127 | EXPECT_NO_REPORT(driver); | 127 | EXPECT_NO_REPORT(driver); |
| 128 | regular_key.release(); | 128 | regular_key.release(); |
| 129 | run_one_scan_loop(); | 129 | run_one_scan_loop(); |
| 130 | testing::Mock::VerifyAndClearExpectations(&driver); | 130 | VERIFY_AND_CLEAR(driver); |
| 131 | 131 | ||
| 132 | /* Release layer-tap-hold key */ | 132 | /* Release layer-tap-hold key */ |
| 133 | EXPECT_REPORT(driver, (KC_P)); | 133 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -136,7 +136,7 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) { | |||
| 136 | EXPECT_EMPTY_REPORT(driver); | 136 | EXPECT_EMPTY_REPORT(driver); |
| 137 | layer_tap_hold_key.release(); | 137 | layer_tap_hold_key.release(); |
| 138 | run_one_scan_loop(); | 138 | run_one_scan_loop(); |
| 139 | testing::Mock::VerifyAndClearExpectations(&driver); | 139 | VERIFY_AND_CLEAR(driver); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { | 142 | TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { |
| @@ -150,26 +150,26 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) { | |||
| 150 | EXPECT_NO_REPORT(driver); | 150 | EXPECT_NO_REPORT(driver); |
| 151 | mod_tap_hold_key.press(); | 151 | mod_tap_hold_key.press(); |
| 152 | run_one_scan_loop(); | 152 | run_one_scan_loop(); |
| 153 | testing::Mock::VerifyAndClearExpectations(&driver); | 153 | VERIFY_AND_CLEAR(driver); |
| 154 | 154 | ||
| 155 | /* Release mod-tap-hold key. */ | 155 | /* Release mod-tap-hold key. */ |
| 156 | EXPECT_REPORT(driver, (KC_P)); | 156 | EXPECT_REPORT(driver, (KC_P)); |
| 157 | EXPECT_EMPTY_REPORT(driver); | 157 | EXPECT_EMPTY_REPORT(driver); |
| 158 | mod_tap_hold_key.release(); | 158 | mod_tap_hold_key.release(); |
| 159 | run_one_scan_loop(); | 159 | run_one_scan_loop(); |
| 160 | testing::Mock::VerifyAndClearExpectations(&driver); | 160 | VERIFY_AND_CLEAR(driver); |
| 161 | 161 | ||
| 162 | /* Press mod-tap-hold key again. */ | 162 | /* Press mod-tap-hold key again. */ |
| 163 | EXPECT_REPORT(driver, (KC_P)); | 163 | EXPECT_REPORT(driver, (KC_P)); |
| 164 | mod_tap_hold_key.press(); | 164 | mod_tap_hold_key.press(); |
| 165 | idle_for(TAPPING_TERM); | 165 | idle_for(TAPPING_TERM); |
| 166 | testing::Mock::VerifyAndClearExpectations(&driver); | 166 | VERIFY_AND_CLEAR(driver); |
| 167 | 167 | ||
| 168 | /* Release mod-tap-hold key. */ | 168 | /* Release mod-tap-hold key. */ |
| 169 | EXPECT_EMPTY_REPORT(driver); | 169 | EXPECT_EMPTY_REPORT(driver); |
| 170 | mod_tap_hold_key.release(); | 170 | mod_tap_hold_key.release(); |
| 171 | run_one_scan_loop(); | 171 | run_one_scan_loop(); |
| 172 | testing::Mock::VerifyAndClearExpectations(&driver); | 172 | VERIFY_AND_CLEAR(driver); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) { | 175 | 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) { | |||
| 183 | EXPECT_NO_REPORT(driver); | 183 | EXPECT_NO_REPORT(driver); |
| 184 | mod_tap_hold_key.press(); | 184 | mod_tap_hold_key.press(); |
| 185 | run_one_scan_loop(); | 185 | run_one_scan_loop(); |
| 186 | testing::Mock::VerifyAndClearExpectations(&driver); | 186 | VERIFY_AND_CLEAR(driver); |
| 187 | 187 | ||
| 188 | /* Release mod-tap-hold key. */ | 188 | /* Release mod-tap-hold key. */ |
| 189 | EXPECT_REPORT(driver, (KC_P)); | 189 | EXPECT_REPORT(driver, (KC_P)); |
| 190 | EXPECT_EMPTY_REPORT(driver); | 190 | EXPECT_EMPTY_REPORT(driver); |
| 191 | mod_tap_hold_key.release(); | 191 | mod_tap_hold_key.release(); |
| 192 | run_one_scan_loop(); | 192 | run_one_scan_loop(); |
| 193 | testing::Mock::VerifyAndClearExpectations(&driver); | 193 | VERIFY_AND_CLEAR(driver); |
| 194 | 194 | ||
| 195 | /* Press mod-tap-hold key again. */ | 195 | /* Press mod-tap-hold key again. */ |
| 196 | EXPECT_REPORT(driver, (KC_P)); | 196 | EXPECT_REPORT(driver, (KC_P)); |
| 197 | mod_tap_hold_key.press(); | 197 | mod_tap_hold_key.press(); |
| 198 | idle_for(TAPPING_TERM); | 198 | idle_for(TAPPING_TERM); |
| 199 | testing::Mock::VerifyAndClearExpectations(&driver); | 199 | VERIFY_AND_CLEAR(driver); |
| 200 | 200 | ||
| 201 | /* Release mod-tap-hold key. */ | 201 | /* Release mod-tap-hold key. */ |
| 202 | EXPECT_EMPTY_REPORT(driver); | 202 | EXPECT_EMPTY_REPORT(driver); |
| 203 | mod_tap_hold_key.release(); | 203 | mod_tap_hold_key.release(); |
| 204 | run_one_scan_loop(); | 204 | run_one_scan_loop(); |
| 205 | testing::Mock::VerifyAndClearExpectations(&driver); | 205 | VERIFY_AND_CLEAR(driver); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { | 208 | TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { |
| @@ -216,11 +216,11 @@ TEST_F(DefaultTapHold, tap_and_hold_mod_tap_hold_key) { | |||
| 216 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 216 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 217 | mod_tap_hold_key.press(); | 217 | mod_tap_hold_key.press(); |
| 218 | idle_for(TAPPING_TERM + 1); | 218 | idle_for(TAPPING_TERM + 1); |
| 219 | testing::Mock::VerifyAndClearExpectations(&driver); | 219 | VERIFY_AND_CLEAR(driver); |
| 220 | 220 | ||
| 221 | /* Release mod-tap-hold key. */ | 221 | /* Release mod-tap-hold key. */ |
| 222 | EXPECT_EMPTY_REPORT(driver); | 222 | EXPECT_EMPTY_REPORT(driver); |
| 223 | mod_tap_hold_key.release(); | 223 | mod_tap_hold_key.release(); |
| 224 | run_one_scan_loop(); | 224 | run_one_scan_loop(); |
| 225 | testing::Mock::VerifyAndClearExpectations(&driver); | 225 | VERIFY_AND_CLEAR(driver); |
| 226 | } | 226 | } |
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) | |||
| 38 | EXPECT_NO_REPORT(driver); | 38 | EXPECT_NO_REPORT(driver); |
| 39 | mod_tap_hold_key.press(); | 39 | mod_tap_hold_key.press(); |
| 40 | run_one_scan_loop(); | 40 | run_one_scan_loop(); |
| 41 | testing::Mock::VerifyAndClearExpectations(&driver); | 41 | VERIFY_AND_CLEAR(driver); |
| 42 | 42 | ||
| 43 | /* Release mod-tap-hold key. */ | 43 | /* Release mod-tap-hold key. */ |
| 44 | EXPECT_REPORT(driver, (KC_P)); | 44 | EXPECT_REPORT(driver, (KC_P)); |
| 45 | EXPECT_EMPTY_REPORT(driver); | 45 | EXPECT_EMPTY_REPORT(driver); |
| 46 | mod_tap_hold_key.release(); | 46 | mod_tap_hold_key.release(); |
| 47 | run_one_scan_loop(); | 47 | run_one_scan_loop(); |
| 48 | testing::Mock::VerifyAndClearExpectations(&driver); | 48 | VERIFY_AND_CLEAR(driver); |
| 49 | 49 | ||
| 50 | /* Press regular key. */ | 50 | /* Press regular key. */ |
| 51 | EXPECT_REPORT(driver, (KC_A)); | 51 | EXPECT_REPORT(driver, (KC_A)); |
| 52 | regular_key.press(); | 52 | regular_key.press(); |
| 53 | run_one_scan_loop(); | 53 | run_one_scan_loop(); |
| 54 | testing::Mock::VerifyAndClearExpectations(&driver); | 54 | VERIFY_AND_CLEAR(driver); |
| 55 | 55 | ||
| 56 | /* Release regular key. */ | 56 | /* Release regular key. */ |
| 57 | EXPECT_EMPTY_REPORT(driver); | 57 | EXPECT_EMPTY_REPORT(driver); |
| 58 | regular_key.release(); | 58 | regular_key.release(); |
| 59 | run_one_scan_loop(); | 59 | run_one_scan_loop(); |
| 60 | testing::Mock::VerifyAndClearExpectations(&driver); | 60 | VERIFY_AND_CLEAR(driver); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_mod_tap_key_and_regular_key) { | 63 | 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) { | |||
| 72 | EXPECT_NO_REPORT(driver); | 72 | EXPECT_NO_REPORT(driver); |
| 73 | mod_tap_hold_key.press(); | 73 | mod_tap_hold_key.press(); |
| 74 | run_one_scan_loop(); | 74 | run_one_scan_loop(); |
| 75 | testing::Mock::VerifyAndClearExpectations(&driver); | 75 | VERIFY_AND_CLEAR(driver); |
| 76 | 76 | ||
| 77 | /* Idle for tapping term of mod tap hold key. */ | 77 | /* Idle for tapping term of mod tap hold key. */ |
| 78 | EXPECT_REPORT(driver, (KC_LSFT)); | 78 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 79 | idle_for(TAPPING_TERM + 1); | 79 | idle_for(TAPPING_TERM + 1); |
| 80 | testing::Mock::VerifyAndClearExpectations(&driver); | 80 | VERIFY_AND_CLEAR(driver); |
| 81 | 81 | ||
| 82 | /* Release mod-tap-hold key. */ | 82 | /* Release mod-tap-hold key. */ |
| 83 | EXPECT_EMPTY_REPORT(driver); | 83 | EXPECT_EMPTY_REPORT(driver); |
| 84 | mod_tap_hold_key.release(); | 84 | mod_tap_hold_key.release(); |
| 85 | run_one_scan_loop(); | 85 | run_one_scan_loop(); |
| 86 | testing::Mock::VerifyAndClearExpectations(&driver); | 86 | VERIFY_AND_CLEAR(driver); |
| 87 | 87 | ||
| 88 | /* Press regular key. */ | 88 | /* Press regular key. */ |
| 89 | EXPECT_REPORT(driver, (KC_A)); | 89 | EXPECT_REPORT(driver, (KC_A)); |
| 90 | regular_key.press(); | 90 | regular_key.press(); |
| 91 | run_one_scan_loop(); | 91 | run_one_scan_loop(); |
| 92 | testing::Mock::VerifyAndClearExpectations(&driver); | 92 | VERIFY_AND_CLEAR(driver); |
| 93 | 93 | ||
| 94 | /* Release regular key. */ | 94 | /* Release regular key. */ |
| 95 | EXPECT_EMPTY_REPORT(driver); | 95 | EXPECT_EMPTY_REPORT(driver); |
| 96 | regular_key.release(); | 96 | regular_key.release(); |
| 97 | run_one_scan_loop(); | 97 | run_one_scan_loop(); |
| 98 | testing::Mock::VerifyAndClearExpectations(&driver); | 98 | VERIFY_AND_CLEAR(driver); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | TEST_F(HoldOnOtherKeyPress, short_distinct_taps_of_layer_tap_key_and_regular_key) { | 101 | 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 | |||
| 111 | EXPECT_NO_REPORT(driver); | 111 | EXPECT_NO_REPORT(driver); |
| 112 | layer_tap_hold_key.press(); | 112 | layer_tap_hold_key.press(); |
| 113 | run_one_scan_loop(); | 113 | run_one_scan_loop(); |
| 114 | testing::Mock::VerifyAndClearExpectations(&driver); | 114 | VERIFY_AND_CLEAR(driver); |
| 115 | 115 | ||
| 116 | /* Release layer-tap-hold key. */ | 116 | /* Release layer-tap-hold key. */ |
| 117 | EXPECT_REPORT(driver, (KC_P)); | 117 | EXPECT_REPORT(driver, (KC_P)); |
| 118 | EXPECT_EMPTY_REPORT(driver); | 118 | EXPECT_EMPTY_REPORT(driver); |
| 119 | layer_tap_hold_key.release(); | 119 | layer_tap_hold_key.release(); |
| 120 | run_one_scan_loop(); | 120 | run_one_scan_loop(); |
| 121 | testing::Mock::VerifyAndClearExpectations(&driver); | 121 | VERIFY_AND_CLEAR(driver); |
| 122 | 122 | ||
| 123 | /* Press regular key. */ | 123 | /* Press regular key. */ |
| 124 | EXPECT_REPORT(driver, (KC_A)); | 124 | EXPECT_REPORT(driver, (KC_A)); |
| 125 | regular_key.press(); | 125 | regular_key.press(); |
| 126 | run_one_scan_loop(); | 126 | run_one_scan_loop(); |
| 127 | testing::Mock::VerifyAndClearExpectations(&driver); | 127 | VERIFY_AND_CLEAR(driver); |
| 128 | 128 | ||
| 129 | /* Release regular key. */ | 129 | /* Release regular key. */ |
| 130 | EXPECT_EMPTY_REPORT(driver); | 130 | EXPECT_EMPTY_REPORT(driver); |
| 131 | regular_key.release(); | 131 | regular_key.release(); |
| 132 | run_one_scan_loop(); | 132 | run_one_scan_loop(); |
| 133 | testing::Mock::VerifyAndClearExpectations(&driver); | 133 | VERIFY_AND_CLEAR(driver); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | TEST_F(HoldOnOtherKeyPress, long_distinct_taps_of_layer_tap_key_and_regular_key) { | 136 | 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) | |||
| 146 | EXPECT_NO_REPORT(driver); | 146 | EXPECT_NO_REPORT(driver); |
| 147 | layer_tap_hold_key.press(); | 147 | layer_tap_hold_key.press(); |
| 148 | run_one_scan_loop(); | 148 | run_one_scan_loop(); |
| 149 | testing::Mock::VerifyAndClearExpectations(&driver); | 149 | VERIFY_AND_CLEAR(driver); |
| 150 | 150 | ||
| 151 | /* Idle for tapping term of layer tap hold key. */ | 151 | /* Idle for tapping term of layer tap hold key. */ |
| 152 | EXPECT_NO_REPORT(driver); | 152 | EXPECT_NO_REPORT(driver); |
| 153 | idle_for(TAPPING_TERM + 1); | 153 | idle_for(TAPPING_TERM + 1); |
| 154 | testing::Mock::VerifyAndClearExpectations(&driver); | 154 | VERIFY_AND_CLEAR(driver); |
| 155 | 155 | ||
| 156 | /* Release layer-tap-hold key. */ | 156 | /* Release layer-tap-hold key. */ |
| 157 | EXPECT_NO_REPORT(driver); | 157 | EXPECT_NO_REPORT(driver); |
| 158 | layer_tap_hold_key.release(); | 158 | layer_tap_hold_key.release(); |
| 159 | run_one_scan_loop(); | 159 | run_one_scan_loop(); |
| 160 | testing::Mock::VerifyAndClearExpectations(&driver); | 160 | VERIFY_AND_CLEAR(driver); |
| 161 | 161 | ||
| 162 | /* Press regular key. */ | 162 | /* Press regular key. */ |
| 163 | EXPECT_REPORT(driver, (KC_A)); | 163 | EXPECT_REPORT(driver, (KC_A)); |
| 164 | regular_key.press(); | 164 | regular_key.press(); |
| 165 | run_one_scan_loop(); | 165 | run_one_scan_loop(); |
| 166 | testing::Mock::VerifyAndClearExpectations(&driver); | 166 | VERIFY_AND_CLEAR(driver); |
| 167 | 167 | ||
| 168 | /* Release regular key. */ | 168 | /* Release regular key. */ |
| 169 | EXPECT_EMPTY_REPORT(driver); | 169 | EXPECT_EMPTY_REPORT(driver); |
| 170 | regular_key.release(); | 170 | regular_key.release(); |
| 171 | run_one_scan_loop(); | 171 | run_one_scan_loop(); |
| 172 | testing::Mock::VerifyAndClearExpectations(&driver); | 172 | VERIFY_AND_CLEAR(driver); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_mod_tap_key_is_held) { | 175 | 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) { | |||
| 184 | EXPECT_NO_REPORT(driver); | 184 | EXPECT_NO_REPORT(driver); |
| 185 | mod_tap_hold_key.press(); | 185 | mod_tap_hold_key.press(); |
| 186 | run_one_scan_loop(); | 186 | run_one_scan_loop(); |
| 187 | testing::Mock::VerifyAndClearExpectations(&driver); | 187 | VERIFY_AND_CLEAR(driver); |
| 188 | 188 | ||
| 189 | /* Press regular key. */ | 189 | /* Press regular key. */ |
| 190 | EXPECT_REPORT(driver, (KC_LSFT)); | 190 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 191 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); | 191 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); |
| 192 | regular_key.press(); | 192 | regular_key.press(); |
| 193 | run_one_scan_loop(); | 193 | run_one_scan_loop(); |
| 194 | testing::Mock::VerifyAndClearExpectations(&driver); | 194 | VERIFY_AND_CLEAR(driver); |
| 195 | 195 | ||
| 196 | /* Release regular key. */ | 196 | /* Release regular key. */ |
| 197 | EXPECT_REPORT(driver, (KC_LSFT)); | 197 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 198 | regular_key.release(); | 198 | regular_key.release(); |
| 199 | run_one_scan_loop(); | 199 | run_one_scan_loop(); |
| 200 | testing::Mock::VerifyAndClearExpectations(&driver); | 200 | VERIFY_AND_CLEAR(driver); |
| 201 | 201 | ||
| 202 | /* Release mod-tap-hold key. */ | 202 | /* Release mod-tap-hold key. */ |
| 203 | EXPECT_EMPTY_REPORT(driver); | 203 | EXPECT_EMPTY_REPORT(driver); |
| 204 | mod_tap_hold_key.release(); | 204 | mod_tap_hold_key.release(); |
| 205 | run_one_scan_loop(); | 205 | run_one_scan_loop(); |
| 206 | testing::Mock::VerifyAndClearExpectations(&driver); | 206 | VERIFY_AND_CLEAR(driver); |
| 207 | 207 | ||
| 208 | /* Idle for tapping term of mod tap hold key. */ | 208 | /* Idle for tapping term of mod tap hold key. */ |
| 209 | idle_for(TAPPING_TERM - 3); | 209 | idle_for(TAPPING_TERM - 3); |
| 210 | testing::Mock::VerifyAndClearExpectations(&driver); | 210 | VERIFY_AND_CLEAR(driver); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | TEST_F(HoldOnOtherKeyPress, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { | 213 | 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) | |||
| 222 | EXPECT_NO_REPORT(driver); | 222 | EXPECT_NO_REPORT(driver); |
| 223 | first_mod_tap_hold_key.press(); | 223 | first_mod_tap_hold_key.press(); |
| 224 | run_one_scan_loop(); | 224 | run_one_scan_loop(); |
| 225 | testing::Mock::VerifyAndClearExpectations(&driver); | 225 | VERIFY_AND_CLEAR(driver); |
| 226 | 226 | ||
| 227 | /* Press second tap-hold key */ | 227 | /* Press second tap-hold key */ |
| 228 | EXPECT_REPORT(driver, (KC_LSFT)); | 228 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 229 | second_mod_tap_hold_key.press(); | 229 | second_mod_tap_hold_key.press(); |
| 230 | run_one_scan_loop(); | 230 | run_one_scan_loop(); |
| 231 | testing::Mock::VerifyAndClearExpectations(&driver); | 231 | VERIFY_AND_CLEAR(driver); |
| 232 | 232 | ||
| 233 | /* Release second tap-hold key */ | 233 | /* Release second tap-hold key */ |
| 234 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); | 234 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); |
| 235 | EXPECT_REPORT(driver, (KC_LSFT)); | 235 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 236 | second_mod_tap_hold_key.release(); | 236 | second_mod_tap_hold_key.release(); |
| 237 | run_one_scan_loop(); | 237 | run_one_scan_loop(); |
| 238 | testing::Mock::VerifyAndClearExpectations(&driver); | 238 | VERIFY_AND_CLEAR(driver); |
| 239 | 239 | ||
| 240 | /* Release first mod-tap-hold key */ | 240 | /* Release first mod-tap-hold key */ |
| 241 | EXPECT_EMPTY_REPORT(driver); | 241 | EXPECT_EMPTY_REPORT(driver); |
| 242 | first_mod_tap_hold_key.release(); | 242 | first_mod_tap_hold_key.release(); |
| 243 | run_one_scan_loop(); | 243 | run_one_scan_loop(); |
| 244 | testing::Mock::VerifyAndClearExpectations(&driver); | 244 | VERIFY_AND_CLEAR(driver); |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | TEST_F(HoldOnOtherKeyPress, tap_regular_key_while_layer_tap_key_is_held) { | 247 | 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) { | |||
| 257 | EXPECT_NO_REPORT(driver); | 257 | EXPECT_NO_REPORT(driver); |
| 258 | layer_tap_hold_key.press(); | 258 | layer_tap_hold_key.press(); |
| 259 | run_one_scan_loop(); | 259 | run_one_scan_loop(); |
| 260 | testing::Mock::VerifyAndClearExpectations(&driver); | 260 | VERIFY_AND_CLEAR(driver); |
| 261 | 261 | ||
| 262 | /* Press regular key */ | 262 | /* Press regular key */ |
| 263 | EXPECT_REPORT(driver, (KC_B)); | 263 | EXPECT_REPORT(driver, (KC_B)); |
| 264 | regular_key.press(); | 264 | regular_key.press(); |
| 265 | run_one_scan_loop(); | 265 | run_one_scan_loop(); |
| 266 | testing::Mock::VerifyAndClearExpectations(&driver); | 266 | VERIFY_AND_CLEAR(driver); |
| 267 | 267 | ||
| 268 | /* Release regular key */ | 268 | /* Release regular key */ |
| 269 | EXPECT_EMPTY_REPORT(driver); | 269 | EXPECT_EMPTY_REPORT(driver); |
| 270 | regular_key.release(); | 270 | regular_key.release(); |
| 271 | run_one_scan_loop(); | 271 | run_one_scan_loop(); |
| 272 | testing::Mock::VerifyAndClearExpectations(&driver); | 272 | VERIFY_AND_CLEAR(driver); |
| 273 | 273 | ||
| 274 | /* Release layer-tap-hold key */ | 274 | /* Release layer-tap-hold key */ |
| 275 | EXPECT_NO_REPORT(driver); | 275 | EXPECT_NO_REPORT(driver); |
| 276 | layer_tap_hold_key.release(); | 276 | layer_tap_hold_key.release(); |
| 277 | run_one_scan_loop(); | 277 | run_one_scan_loop(); |
| 278 | testing::Mock::VerifyAndClearExpectations(&driver); | 278 | VERIFY_AND_CLEAR(driver); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_0_layer_tap_keys) { | 281 | 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) { | |||
| 293 | EXPECT_NO_REPORT(driver); | 293 | EXPECT_NO_REPORT(driver); |
| 294 | first_layer_tap_key.press(); | 294 | first_layer_tap_key.press(); |
| 295 | run_one_scan_loop(); | 295 | run_one_scan_loop(); |
| 296 | testing::Mock::VerifyAndClearExpectations(&driver); | 296 | VERIFY_AND_CLEAR(driver); |
| 297 | 297 | ||
| 298 | /* Press second layer-tap key */ | 298 | /* Press second layer-tap key */ |
| 299 | EXPECT_REPORT(driver, (KC_Q)); | 299 | EXPECT_REPORT(driver, (KC_Q)); |
| 300 | second_layer_tap_key.press(); | 300 | second_layer_tap_key.press(); |
| 301 | run_one_scan_loop(); | 301 | run_one_scan_loop(); |
| 302 | testing::Mock::VerifyAndClearExpectations(&driver); | 302 | VERIFY_AND_CLEAR(driver); |
| 303 | 303 | ||
| 304 | /* Release second layer-tap key */ | 304 | /* Release second layer-tap key */ |
| 305 | EXPECT_EMPTY_REPORT(driver); | 305 | EXPECT_EMPTY_REPORT(driver); |
| 306 | second_layer_tap_key.release(); | 306 | second_layer_tap_key.release(); |
| 307 | run_one_scan_loop(); | 307 | run_one_scan_loop(); |
| 308 | testing::Mock::VerifyAndClearExpectations(&driver); | 308 | VERIFY_AND_CLEAR(driver); |
| 309 | 309 | ||
| 310 | /* Release first layer-tap key */ | 310 | /* Release first layer-tap key */ |
| 311 | EXPECT_NO_REPORT(driver); | 311 | EXPECT_NO_REPORT(driver); |
| 312 | first_layer_tap_key.release(); | 312 | first_layer_tap_key.release(); |
| 313 | run_one_scan_loop(); | 313 | run_one_scan_loop(); |
| 314 | testing::Mock::VerifyAndClearExpectations(&driver); | 314 | VERIFY_AND_CLEAR(driver); |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { | 317 | TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { |
| @@ -331,26 +331,26 @@ TEST_F(HoldOnOtherKeyPress, nested_tap_of_layer_tap_keys) { | |||
| 331 | EXPECT_NO_REPORT(driver); | 331 | EXPECT_NO_REPORT(driver); |
| 332 | first_key_layer_0.press(); | 332 | first_key_layer_0.press(); |
| 333 | run_one_scan_loop(); | 333 | run_one_scan_loop(); |
| 334 | testing::Mock::VerifyAndClearExpectations(&driver); | 334 | VERIFY_AND_CLEAR(driver); |
| 335 | 335 | ||
| 336 | /* Press second layer-tap key */ | 336 | /* Press second layer-tap key */ |
| 337 | EXPECT_NO_REPORT(driver); | 337 | EXPECT_NO_REPORT(driver); |
| 338 | second_key_layer_0.press(); | 338 | second_key_layer_0.press(); |
| 339 | run_one_scan_loop(); | 339 | run_one_scan_loop(); |
| 340 | testing::Mock::VerifyAndClearExpectations(&driver); | 340 | VERIFY_AND_CLEAR(driver); |
| 341 | 341 | ||
| 342 | /* Release second layer-tap key */ | 342 | /* Release second layer-tap key */ |
| 343 | EXPECT_REPORT(driver, (KC_Q)); | 343 | EXPECT_REPORT(driver, (KC_Q)); |
| 344 | EXPECT_EMPTY_REPORT(driver); | 344 | EXPECT_EMPTY_REPORT(driver); |
| 345 | second_key_layer_0.release(); | 345 | second_key_layer_0.release(); |
| 346 | run_one_scan_loop(); | 346 | run_one_scan_loop(); |
| 347 | testing::Mock::VerifyAndClearExpectations(&driver); | 347 | VERIFY_AND_CLEAR(driver); |
| 348 | 348 | ||
| 349 | /* Release first layer-tap key */ | 349 | /* Release first layer-tap key */ |
| 350 | EXPECT_NO_REPORT(driver); | 350 | EXPECT_NO_REPORT(driver); |
| 351 | first_key_layer_0.release(); | 351 | first_key_layer_0.release(); |
| 352 | run_one_scan_loop(); | 352 | run_one_scan_loop(); |
| 353 | testing::Mock::VerifyAndClearExpectations(&driver); | 353 | VERIFY_AND_CLEAR(driver); |
| 354 | } | 354 | } |
| 355 | 355 | ||
| 356 | TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { | 356 | TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { |
| @@ -365,26 +365,26 @@ TEST_F(HoldOnOtherKeyPress, roll_mod_tap_key_with_regular_key) { | |||
| 365 | EXPECT_NO_REPORT(driver); | 365 | EXPECT_NO_REPORT(driver); |
| 366 | mod_tap_hold_key.press(); | 366 | mod_tap_hold_key.press(); |
| 367 | run_one_scan_loop(); | 367 | run_one_scan_loop(); |
| 368 | testing::Mock::VerifyAndClearExpectations(&driver); | 368 | VERIFY_AND_CLEAR(driver); |
| 369 | 369 | ||
| 370 | /* Press regular key. */ | 370 | /* Press regular key. */ |
| 371 | EXPECT_REPORT(driver, (KC_LSFT)); | 371 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 372 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); | 372 | EXPECT_REPORT(driver, (KC_A, KC_LSFT)); |
| 373 | regular_key.press(); | 373 | regular_key.press(); |
| 374 | run_one_scan_loop(); | 374 | run_one_scan_loop(); |
| 375 | testing::Mock::VerifyAndClearExpectations(&driver); | 375 | VERIFY_AND_CLEAR(driver); |
| 376 | 376 | ||
| 377 | /* Release mod-tap-hold key. */ | 377 | /* Release mod-tap-hold key. */ |
| 378 | EXPECT_REPORT(driver, (KC_A)); | 378 | EXPECT_REPORT(driver, (KC_A)); |
| 379 | mod_tap_hold_key.release(); | 379 | mod_tap_hold_key.release(); |
| 380 | run_one_scan_loop(); | 380 | run_one_scan_loop(); |
| 381 | testing::Mock::VerifyAndClearExpectations(&driver); | 381 | VERIFY_AND_CLEAR(driver); |
| 382 | 382 | ||
| 383 | /* Release regular key. */ | 383 | /* Release regular key. */ |
| 384 | EXPECT_EMPTY_REPORT(driver); | 384 | EXPECT_EMPTY_REPORT(driver); |
| 385 | regular_key.release(); | 385 | regular_key.release(); |
| 386 | run_one_scan_loop(); | 386 | run_one_scan_loop(); |
| 387 | testing::Mock::VerifyAndClearExpectations(&driver); | 387 | VERIFY_AND_CLEAR(driver); |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | TEST_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { | 390 | TEST_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { |
| @@ -401,23 +401,23 @@ TEST_F(HoldOnOtherKeyPress, roll_layer_tap_key_with_regular_key) { | |||
| 401 | EXPECT_NO_REPORT(driver); | 401 | EXPECT_NO_REPORT(driver); |
| 402 | layer_tap_hold_key.press(); | 402 | layer_tap_hold_key.press(); |
| 403 | run_one_scan_loop(); | 403 | run_one_scan_loop(); |
| 404 | testing::Mock::VerifyAndClearExpectations(&driver); | 404 | VERIFY_AND_CLEAR(driver); |
| 405 | 405 | ||
| 406 | /* Press regular key */ | 406 | /* Press regular key */ |
| 407 | EXPECT_REPORT(driver, (KC_B)); | 407 | EXPECT_REPORT(driver, (KC_B)); |
| 408 | regular_key.press(); | 408 | regular_key.press(); |
| 409 | run_one_scan_loop(); | 409 | run_one_scan_loop(); |
| 410 | testing::Mock::VerifyAndClearExpectations(&driver); | 410 | VERIFY_AND_CLEAR(driver); |
| 411 | 411 | ||
| 412 | /* Release layer-tap-hold key */ | 412 | /* Release layer-tap-hold key */ |
| 413 | EXPECT_NO_REPORT(driver); | 413 | EXPECT_NO_REPORT(driver); |
| 414 | layer_tap_hold_key.release(); | 414 | layer_tap_hold_key.release(); |
| 415 | run_one_scan_loop(); | 415 | run_one_scan_loop(); |
| 416 | testing::Mock::VerifyAndClearExpectations(&driver); | 416 | VERIFY_AND_CLEAR(driver); |
| 417 | 417 | ||
| 418 | /* Release regular key */ | 418 | /* Release regular key */ |
| 419 | EXPECT_EMPTY_REPORT(driver); | 419 | EXPECT_EMPTY_REPORT(driver); |
| 420 | regular_key.release(); | 420 | regular_key.release(); |
| 421 | run_one_scan_loop(); | 421 | run_one_scan_loop(); |
| 422 | testing::Mock::VerifyAndClearExpectations(&driver); | 422 | VERIFY_AND_CLEAR(driver); |
| 423 | } | 423 | } |
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 | |||
| 35 | EXPECT_NO_REPORT(driver); | 35 | EXPECT_NO_REPORT(driver); |
| 36 | osm_key.press(); | 36 | osm_key.press(); |
| 37 | run_one_scan_loop(); | 37 | run_one_scan_loop(); |
| 38 | testing::Mock::VerifyAndClearExpectations(&driver); | 38 | VERIFY_AND_CLEAR(driver); |
| 39 | 39 | ||
| 40 | /* Press regular key */ | 40 | /* Press regular key */ |
| 41 | EXPECT_NO_REPORT(driver); | 41 | EXPECT_NO_REPORT(driver); |
| 42 | regular_key.press(); | 42 | regular_key.press(); |
| 43 | run_one_scan_loop(); | 43 | run_one_scan_loop(); |
| 44 | testing::Mock::VerifyAndClearExpectations(&driver); | 44 | VERIFY_AND_CLEAR(driver); |
| 45 | 45 | ||
| 46 | /* Release regular key */ | 46 | /* Release regular key */ |
| 47 | EXPECT_REPORT(driver, (osm_key.report_code)).Times(2); | 47 | EXPECT_REPORT(driver, (osm_key.report_code)).Times(2); |
| 48 | EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); | 48 | EXPECT_REPORT(driver, (regular_key.report_code, osm_key.report_code)).Times(1); |
| 49 | regular_key.release(); | 49 | regular_key.release(); |
| 50 | run_one_scan_loop(); | 50 | run_one_scan_loop(); |
| 51 | testing::Mock::VerifyAndClearExpectations(&driver); | 51 | VERIFY_AND_CLEAR(driver); |
| 52 | 52 | ||
| 53 | /* Release OSM */ | 53 | /* Release OSM */ |
| 54 | EXPECT_EMPTY_REPORT(driver).Times(1); | 54 | EXPECT_EMPTY_REPORT(driver).Times(1); |
| 55 | osm_key.release(); | 55 | osm_key.release(); |
| 56 | run_one_scan_loop(); | 56 | run_one_scan_loop(); |
| 57 | testing::Mock::VerifyAndClearExpectations(&driver); | 57 | VERIFY_AND_CLEAR(driver); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | // clang-format off | 60 | // 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) { | |||
| 37 | EXPECT_NO_REPORT(driver); | 37 | EXPECT_NO_REPORT(driver); |
| 38 | mod_tap_hold_key.press(); | 38 | mod_tap_hold_key.press(); |
| 39 | run_one_scan_loop(); | 39 | run_one_scan_loop(); |
| 40 | testing::Mock::VerifyAndClearExpectations(&driver); | 40 | VERIFY_AND_CLEAR(driver); |
| 41 | 41 | ||
| 42 | /* Press regular key */ | 42 | /* Press regular key */ |
| 43 | EXPECT_NO_REPORT(driver); | 43 | EXPECT_NO_REPORT(driver); |
| 44 | regular_key.press(); | 44 | regular_key.press(); |
| 45 | run_one_scan_loop(); | 45 | run_one_scan_loop(); |
| 46 | testing::Mock::VerifyAndClearExpectations(&driver); | 46 | VERIFY_AND_CLEAR(driver); |
| 47 | 47 | ||
| 48 | /* Release regular key */ | 48 | /* Release regular key */ |
| 49 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 49 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| @@ -51,13 +51,13 @@ TEST_F(PermissiveHold, tap_regular_key_while_mod_tap_key_is_held) { | |||
| 51 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 51 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 52 | regular_key.release(); | 52 | regular_key.release(); |
| 53 | run_one_scan_loop(); | 53 | run_one_scan_loop(); |
| 54 | testing::Mock::VerifyAndClearExpectations(&driver); | 54 | VERIFY_AND_CLEAR(driver); |
| 55 | 55 | ||
| 56 | /* Release mod-tap-hold key */ | 56 | /* Release mod-tap-hold key */ |
| 57 | EXPECT_EMPTY_REPORT(driver); | 57 | EXPECT_EMPTY_REPORT(driver); |
| 58 | mod_tap_hold_key.release(); | 58 | mod_tap_hold_key.release(); |
| 59 | run_one_scan_loop(); | 59 | run_one_scan_loop(); |
| 60 | testing::Mock::VerifyAndClearExpectations(&driver); | 60 | VERIFY_AND_CLEAR(driver); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | TEST_F(PermissiveHold, tap_a_mod_tap_key_while_another_mod_tap_key_is_held) { | 63 | 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) { | |||
| 72 | EXPECT_NO_REPORT(driver); | 72 | EXPECT_NO_REPORT(driver); |
| 73 | first_mod_tap_hold_key.press(); | 73 | first_mod_tap_hold_key.press(); |
| 74 | run_one_scan_loop(); | 74 | run_one_scan_loop(); |
| 75 | testing::Mock::VerifyAndClearExpectations(&driver); | 75 | VERIFY_AND_CLEAR(driver); |
| 76 | 76 | ||
| 77 | /* Press second mod-tap-hold key */ | 77 | /* Press second mod-tap-hold key */ |
| 78 | EXPECT_NO_REPORT(driver); | 78 | EXPECT_NO_REPORT(driver); |
| 79 | second_mod_tap_hold_key.press(); | 79 | second_mod_tap_hold_key.press(); |
| 80 | run_one_scan_loop(); | 80 | run_one_scan_loop(); |
| 81 | testing::Mock::VerifyAndClearExpectations(&driver); | 81 | VERIFY_AND_CLEAR(driver); |
| 82 | 82 | ||
| 83 | /* Release second mod-tap-hold key */ | 83 | /* Release second mod-tap-hold key */ |
| 84 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 84 | 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) { | |||
| 86 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); | 86 | EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); |
| 87 | second_mod_tap_hold_key.release(); | 87 | second_mod_tap_hold_key.release(); |
| 88 | run_one_scan_loop(); | 88 | run_one_scan_loop(); |
| 89 | testing::Mock::VerifyAndClearExpectations(&driver); | 89 | VERIFY_AND_CLEAR(driver); |
| 90 | 90 | ||
| 91 | /* Release first mod-tap-hold key */ | 91 | /* Release first mod-tap-hold key */ |
| 92 | EXPECT_EMPTY_REPORT(driver); | 92 | EXPECT_EMPTY_REPORT(driver); |
| 93 | first_mod_tap_hold_key.release(); | 93 | first_mod_tap_hold_key.release(); |
| 94 | run_one_scan_loop(); | 94 | run_one_scan_loop(); |
| 95 | testing::Mock::VerifyAndClearExpectations(&driver); | 95 | VERIFY_AND_CLEAR(driver); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | TEST_F(PermissiveHold, tap_regular_key_while_layer_tap_key_is_held) { | 98 | 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) { | |||
| 108 | EXPECT_NO_REPORT(driver); | 108 | EXPECT_NO_REPORT(driver); |
| 109 | layer_tap_hold_key.press(); | 109 | layer_tap_hold_key.press(); |
| 110 | run_one_scan_loop(); | 110 | run_one_scan_loop(); |
| 111 | testing::Mock::VerifyAndClearExpectations(&driver); | 111 | VERIFY_AND_CLEAR(driver); |
| 112 | 112 | ||
| 113 | /* Press regular key */ | 113 | /* Press regular key */ |
| 114 | EXPECT_NO_REPORT(driver); | 114 | EXPECT_NO_REPORT(driver); |
| 115 | regular_key.press(); | 115 | regular_key.press(); |
| 116 | run_one_scan_loop(); | 116 | run_one_scan_loop(); |
| 117 | testing::Mock::VerifyAndClearExpectations(&driver); | 117 | VERIFY_AND_CLEAR(driver); |
| 118 | 118 | ||
| 119 | /* Release regular key */ | 119 | /* Release regular key */ |
| 120 | EXPECT_REPORT(driver, (layer_key.report_code)); | 120 | EXPECT_REPORT(driver, (layer_key.report_code)); |
| 121 | EXPECT_EMPTY_REPORT(driver); | 121 | EXPECT_EMPTY_REPORT(driver); |
| 122 | regular_key.release(); | 122 | regular_key.release(); |
| 123 | run_one_scan_loop(); | 123 | run_one_scan_loop(); |
| 124 | testing::Mock::VerifyAndClearExpectations(&driver); | 124 | VERIFY_AND_CLEAR(driver); |
| 125 | 125 | ||
| 126 | /* Release layer-tap-hold key */ | 126 | /* Release layer-tap-hold key */ |
| 127 | EXPECT_NO_REPORT(driver); | 127 | EXPECT_NO_REPORT(driver); |
| 128 | layer_tap_hold_key.release(); | 128 | layer_tap_hold_key.release(); |
| 129 | run_one_scan_loop(); | 129 | run_one_scan_loop(); |
| 130 | testing::Mock::VerifyAndClearExpectations(&driver); | 130 | VERIFY_AND_CLEAR(driver); |
| 131 | } | 131 | } |
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) { | |||
| 66 | run_one_scan_loop(); | 66 | run_one_scan_loop(); |
| 67 | expect_layer_state(0); | 67 | expect_layer_state(0); |
| 68 | 68 | ||
| 69 | testing::Mock::VerifyAndClearExpectations(&driver); | 69 | VERIFY_AND_CLEAR(driver); |
| 70 | 70 | ||
| 71 | EXPECT_REPORT(driver, (KC_A)).Times(1); | 71 | EXPECT_REPORT(driver, (KC_A)).Times(1); |
| 72 | regular_key.press(); | 72 | regular_key.press(); |
| 73 | run_one_scan_loop(); | 73 | run_one_scan_loop(); |
| 74 | expect_layer_state(0); | 74 | expect_layer_state(0); |
| 75 | testing::Mock::VerifyAndClearExpectations(&driver); | 75 | VERIFY_AND_CLEAR(driver); |
| 76 | 76 | ||
| 77 | EXPECT_EMPTY_REPORT(driver).Times(1); | 77 | EXPECT_EMPTY_REPORT(driver).Times(1); |
| 78 | regular_key.release(); | 78 | regular_key.release(); |
| 79 | run_one_scan_loop(); | 79 | run_one_scan_loop(); |
| 80 | expect_layer_state(0); | 80 | expect_layer_state(0); |
| 81 | testing::Mock::VerifyAndClearExpectations(&driver); | 81 | VERIFY_AND_CLEAR(driver); |
| 82 | } | 82 | } |
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) { | |||
| 39 | EXPECT_NO_REPORT(driver); | 39 | EXPECT_NO_REPORT(driver); |
| 40 | mod_tap_key.press(); | 40 | mod_tap_key.press(); |
| 41 | run_one_scan_loop(); | 41 | run_one_scan_loop(); |
| 42 | testing::Mock::VerifyAndClearExpectations(&driver); | 42 | VERIFY_AND_CLEAR(driver); |
| 43 | 43 | ||
| 44 | /* Press regular key. */ | 44 | /* Press regular key. */ |
| 45 | EXPECT_NO_REPORT(driver); | 45 | EXPECT_NO_REPORT(driver); |
| 46 | regular_key.press(); | 46 | regular_key.press(); |
| 47 | run_one_scan_loop(); | 47 | run_one_scan_loop(); |
| 48 | testing::Mock::VerifyAndClearExpectations(&driver); | 48 | VERIFY_AND_CLEAR(driver); |
| 49 | 49 | ||
| 50 | /* Release regular key. */ | 50 | /* Release regular key. */ |
| 51 | EXPECT_NO_REPORT(driver); | 51 | EXPECT_NO_REPORT(driver); |
| 52 | regular_key.release(); | 52 | regular_key.release(); |
| 53 | run_one_scan_loop(); | 53 | run_one_scan_loop(); |
| 54 | testing::Mock::VerifyAndClearExpectations(&driver); | 54 | VERIFY_AND_CLEAR(driver); |
| 55 | 55 | ||
| 56 | /* Release mod-tap key. */ | 56 | /* Release mod-tap key. */ |
| 57 | EXPECT_REPORT(driver, (KC_LSFT)); | 57 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 58 | mod_tap_key.release(); | 58 | mod_tap_key.release(); |
| 59 | run_one_scan_loop(); | 59 | run_one_scan_loop(); |
| 60 | testing::Mock::VerifyAndClearExpectations(&driver); | 60 | VERIFY_AND_CLEAR(driver); |
| 61 | 61 | ||
| 62 | /* Idle for tapping term of mod tap hold key. */ | 62 | /* Idle for tapping term of mod tap hold key. */ |
| 63 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); | 63 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); |
| 64 | EXPECT_REPORT(driver, (KC_LSFT)); | 64 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 65 | EXPECT_EMPTY_REPORT(driver); | 65 | EXPECT_EMPTY_REPORT(driver); |
| 66 | idle_for(TAPPING_TERM - 3); | 66 | idle_for(TAPPING_TERM - 3); |
| 67 | testing::Mock::VerifyAndClearExpectations(&driver); | 67 | VERIFY_AND_CLEAR(driver); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | TEST_F(QuickTap, tap_mod_tap_key_while_mod_tap_key_is_held) { | 70 | 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) { | |||
| 79 | EXPECT_NO_REPORT(driver); | 79 | EXPECT_NO_REPORT(driver); |
| 80 | first_mod_tap_key.press(); | 80 | first_mod_tap_key.press(); |
| 81 | run_one_scan_loop(); | 81 | run_one_scan_loop(); |
| 82 | testing::Mock::VerifyAndClearExpectations(&driver); | 82 | VERIFY_AND_CLEAR(driver); |
| 83 | 83 | ||
| 84 | /* Press second mod-tap key */ | 84 | /* Press second mod-tap key */ |
| 85 | EXPECT_NO_REPORT(driver); | 85 | EXPECT_NO_REPORT(driver); |
| 86 | second_mod_tap_key.press(); | 86 | second_mod_tap_key.press(); |
| 87 | run_one_scan_loop(); | 87 | run_one_scan_loop(); |
| 88 | testing::Mock::VerifyAndClearExpectations(&driver); | 88 | VERIFY_AND_CLEAR(driver); |
| 89 | 89 | ||
| 90 | /* Release second tap-hold key */ | 90 | /* Release second tap-hold key */ |
| 91 | EXPECT_NO_REPORT(driver); | 91 | EXPECT_NO_REPORT(driver); |
| 92 | second_mod_tap_key.release(); | 92 | second_mod_tap_key.release(); |
| 93 | run_one_scan_loop(); | 93 | run_one_scan_loop(); |
| 94 | testing::Mock::VerifyAndClearExpectations(&driver); | 94 | VERIFY_AND_CLEAR(driver); |
| 95 | 95 | ||
| 96 | /* Release first mod-tap key */ | 96 | /* Release first mod-tap key */ |
| 97 | EXPECT_REPORT(driver, (KC_LSFT)); | 97 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 98 | first_mod_tap_key.release(); | 98 | first_mod_tap_key.release(); |
| 99 | run_one_scan_loop(); | 99 | run_one_scan_loop(); |
| 100 | testing::Mock::VerifyAndClearExpectations(&driver); | 100 | VERIFY_AND_CLEAR(driver); |
| 101 | 101 | ||
| 102 | /* Idle for tapping term of first mod-tap key. */ | 102 | /* Idle for tapping term of first mod-tap key. */ |
| 103 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); | 103 | EXPECT_REPORT(driver, (KC_LSFT, KC_A)); |
| 104 | EXPECT_REPORT(driver, (KC_LSFT)); | 104 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 105 | EXPECT_EMPTY_REPORT(driver); | 105 | EXPECT_EMPTY_REPORT(driver); |
| 106 | idle_for(TAPPING_TERM - 3); | 106 | idle_for(TAPPING_TERM - 3); |
| 107 | testing::Mock::VerifyAndClearExpectations(&driver); | 107 | VERIFY_AND_CLEAR(driver); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { | 110 | 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) { | |||
| 120 | EXPECT_NO_REPORT(driver); | 120 | EXPECT_NO_REPORT(driver); |
| 121 | layer_tap_key.press(); | 121 | layer_tap_key.press(); |
| 122 | run_one_scan_loop(); | 122 | run_one_scan_loop(); |
| 123 | testing::Mock::VerifyAndClearExpectations(&driver); | 123 | VERIFY_AND_CLEAR(driver); |
| 124 | 124 | ||
| 125 | /* Press regular key */ | 125 | /* Press regular key */ |
| 126 | EXPECT_NO_REPORT(driver); | 126 | EXPECT_NO_REPORT(driver); |
| 127 | regular_key.press(); | 127 | regular_key.press(); |
| 128 | run_one_scan_loop(); | 128 | run_one_scan_loop(); |
| 129 | testing::Mock::VerifyAndClearExpectations(&driver); | 129 | VERIFY_AND_CLEAR(driver); |
| 130 | 130 | ||
| 131 | /* Release regular key */ | 131 | /* Release regular key */ |
| 132 | EXPECT_NO_REPORT(driver); | 132 | EXPECT_NO_REPORT(driver); |
| 133 | regular_key.release(); | 133 | regular_key.release(); |
| 134 | run_one_scan_loop(); | 134 | run_one_scan_loop(); |
| 135 | testing::Mock::VerifyAndClearExpectations(&driver); | 135 | VERIFY_AND_CLEAR(driver); |
| 136 | 136 | ||
| 137 | /* Release layer-tap key */ | 137 | /* Release layer-tap key */ |
| 138 | EXPECT_REPORT(driver, (KC_P)); | 138 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -141,7 +141,7 @@ TEST_F(QuickTap, tap_regular_key_while_layer_tap_key_is_held) { | |||
| 141 | EXPECT_EMPTY_REPORT(driver); | 141 | EXPECT_EMPTY_REPORT(driver); |
| 142 | layer_tap_key.release(); | 142 | layer_tap_key.release(); |
| 143 | run_one_scan_loop(); | 143 | run_one_scan_loop(); |
| 144 | testing::Mock::VerifyAndClearExpectations(&driver); | 144 | VERIFY_AND_CLEAR(driver); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { | 147 | 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) { | |||
| 155 | EXPECT_NO_REPORT(driver); | 155 | EXPECT_NO_REPORT(driver); |
| 156 | mod_tap_key.press(); | 156 | mod_tap_key.press(); |
| 157 | run_one_scan_loop(); | 157 | run_one_scan_loop(); |
| 158 | testing::Mock::VerifyAndClearExpectations(&driver); | 158 | VERIFY_AND_CLEAR(driver); |
| 159 | 159 | ||
| 160 | /* Release mod-tap key. */ | 160 | /* Release mod-tap key. */ |
| 161 | EXPECT_REPORT(driver, (KC_P)); | 161 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -163,19 +163,19 @@ TEST_F(QuickTap, tap_key_and_tap_again_before_quick_tap_term) { | |||
| 163 | mod_tap_key.release(); | 163 | mod_tap_key.release(); |
| 164 | idle_for(QUICK_TAP_TERM - 10); | 164 | idle_for(QUICK_TAP_TERM - 10); |
| 165 | run_one_scan_loop(); | 165 | run_one_scan_loop(); |
| 166 | testing::Mock::VerifyAndClearExpectations(&driver); | 166 | VERIFY_AND_CLEAR(driver); |
| 167 | 167 | ||
| 168 | /* Press and tap mod-tap key again. */ | 168 | /* Press and tap mod-tap key again. */ |
| 169 | EXPECT_REPORT(driver, (KC_P)); | 169 | EXPECT_REPORT(driver, (KC_P)); |
| 170 | mod_tap_key.press(); | 170 | mod_tap_key.press(); |
| 171 | run_one_scan_loop(); | 171 | run_one_scan_loop(); |
| 172 | testing::Mock::VerifyAndClearExpectations(&driver); | 172 | VERIFY_AND_CLEAR(driver); |
| 173 | 173 | ||
| 174 | /* Release mod-tap key. */ | 174 | /* Release mod-tap key. */ |
| 175 | EXPECT_EMPTY_REPORT(driver); | 175 | EXPECT_EMPTY_REPORT(driver); |
| 176 | mod_tap_key.release(); | 176 | mod_tap_key.release(); |
| 177 | run_one_scan_loop(); | 177 | run_one_scan_loop(); |
| 178 | testing::Mock::VerifyAndClearExpectations(&driver); | 178 | VERIFY_AND_CLEAR(driver); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | TEST_F(QuickTap, tap_key_and_hold_again_before_quick_tap_term) { | 181 | 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) { | |||
| 189 | EXPECT_NO_REPORT(driver); | 189 | EXPECT_NO_REPORT(driver); |
| 190 | mod_tap_key.press(); | 190 | mod_tap_key.press(); |
| 191 | run_one_scan_loop(); | 191 | run_one_scan_loop(); |
| 192 | testing::Mock::VerifyAndClearExpectations(&driver); | 192 | VERIFY_AND_CLEAR(driver); |
| 193 | 193 | ||
| 194 | /* Release mod-tap key. */ | 194 | /* Release mod-tap key. */ |
| 195 | EXPECT_REPORT(driver, (KC_P)); | 195 | EXPECT_REPORT(driver, (KC_P)); |
| 196 | EXPECT_EMPTY_REPORT(driver); | 196 | EXPECT_EMPTY_REPORT(driver); |
| 197 | mod_tap_key.release(); | 197 | mod_tap_key.release(); |
| 198 | idle_for(QUICK_TAP_TERM - 10); | 198 | idle_for(QUICK_TAP_TERM - 10); |
| 199 | testing::Mock::VerifyAndClearExpectations(&driver); | 199 | VERIFY_AND_CLEAR(driver); |
| 200 | 200 | ||
| 201 | /* Press and hold mod-tap key again. */ | 201 | /* Press and hold mod-tap key again. */ |
| 202 | EXPECT_REPORT(driver, (KC_P)); | 202 | EXPECT_REPORT(driver, (KC_P)); |
| 203 | mod_tap_key.press(); | 203 | mod_tap_key.press(); |
| 204 | run_one_scan_loop(); | 204 | run_one_scan_loop(); |
| 205 | testing::Mock::VerifyAndClearExpectations(&driver); | 205 | VERIFY_AND_CLEAR(driver); |
| 206 | 206 | ||
| 207 | /* Wait until tapping term expired */ | 207 | /* Wait until tapping term expired */ |
| 208 | EXPECT_NO_REPORT(driver); | 208 | EXPECT_NO_REPORT(driver); |
| 209 | idle_for(TAPPING_TERM); | 209 | idle_for(TAPPING_TERM); |
| 210 | testing::Mock::VerifyAndClearExpectations(&driver); | 210 | VERIFY_AND_CLEAR(driver); |
| 211 | 211 | ||
| 212 | /* Release mod-tap key. */ | 212 | /* Release mod-tap key. */ |
| 213 | EXPECT_EMPTY_REPORT(driver); | 213 | EXPECT_EMPTY_REPORT(driver); |
| 214 | mod_tap_key.release(); | 214 | mod_tap_key.release(); |
| 215 | run_one_scan_loop(); | 215 | run_one_scan_loop(); |
| 216 | testing::Mock::VerifyAndClearExpectations(&driver); | 216 | VERIFY_AND_CLEAR(driver); |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { | 219 | 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) { | |||
| 227 | EXPECT_NO_REPORT(driver); | 227 | EXPECT_NO_REPORT(driver); |
| 228 | mod_tap_key.press(); | 228 | mod_tap_key.press(); |
| 229 | run_one_scan_loop(); | 229 | run_one_scan_loop(); |
| 230 | testing::Mock::VerifyAndClearExpectations(&driver); | 230 | VERIFY_AND_CLEAR(driver); |
| 231 | 231 | ||
| 232 | /* Release mod-tap key. */ | 232 | /* Release mod-tap key. */ |
| 233 | EXPECT_REPORT(driver, (KC_P)); | 233 | EXPECT_REPORT(driver, (KC_P)); |
| @@ -235,20 +235,20 @@ TEST_F(QuickTap, tap_key_and_tap_again_after_quick_tap_term) { | |||
| 235 | mod_tap_key.release(); | 235 | mod_tap_key.release(); |
| 236 | idle_for(QUICK_TAP_TERM + 10); | 236 | idle_for(QUICK_TAP_TERM + 10); |
| 237 | run_one_scan_loop(); | 237 | run_one_scan_loop(); |
| 238 | testing::Mock::VerifyAndClearExpectations(&driver); | 238 | VERIFY_AND_CLEAR(driver); |
| 239 | 239 | ||
| 240 | /* Press mod-tap key again. */ | 240 | /* Press mod-tap key again. */ |
| 241 | EXPECT_NO_REPORT(driver); | 241 | EXPECT_NO_REPORT(driver); |
| 242 | mod_tap_key.press(); | 242 | mod_tap_key.press(); |
| 243 | run_one_scan_loop(); | 243 | run_one_scan_loop(); |
| 244 | testing::Mock::VerifyAndClearExpectations(&driver); | 244 | VERIFY_AND_CLEAR(driver); |
| 245 | 245 | ||
| 246 | /* Release mod-tap key. */ | 246 | /* Release mod-tap key. */ |
| 247 | EXPECT_REPORT(driver, (KC_P)); | 247 | EXPECT_REPORT(driver, (KC_P)); |
| 248 | EXPECT_EMPTY_REPORT(driver); | 248 | EXPECT_EMPTY_REPORT(driver); |
| 249 | mod_tap_key.release(); | 249 | mod_tap_key.release(); |
| 250 | run_one_scan_loop(); | 250 | run_one_scan_loop(); |
| 251 | testing::Mock::VerifyAndClearExpectations(&driver); | 251 | VERIFY_AND_CLEAR(driver); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | TEST_F(QuickTap, tap_key_and_hold_again_after_quick_tap_term) { | 254 | 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) { | |||
| 262 | EXPECT_NO_REPORT(driver); | 262 | EXPECT_NO_REPORT(driver); |
| 263 | mod_tap_key.press(); | 263 | mod_tap_key.press(); |
| 264 | run_one_scan_loop(); | 264 | run_one_scan_loop(); |
| 265 | testing::Mock::VerifyAndClearExpectations(&driver); | 265 | VERIFY_AND_CLEAR(driver); |
| 266 | 266 | ||
| 267 | /* Release mod-tap key. */ | 267 | /* Release mod-tap key. */ |
| 268 | EXPECT_REPORT(driver, (KC_P)); | 268 | EXPECT_REPORT(driver, (KC_P)); |
| 269 | EXPECT_EMPTY_REPORT(driver); | 269 | EXPECT_EMPTY_REPORT(driver); |
| 270 | mod_tap_key.release(); | 270 | mod_tap_key.release(); |
| 271 | idle_for(QUICK_TAP_TERM + 10); | 271 | idle_for(QUICK_TAP_TERM + 10); |
| 272 | testing::Mock::VerifyAndClearExpectations(&driver); | 272 | VERIFY_AND_CLEAR(driver); |
| 273 | 273 | ||
| 274 | /* Press and hold mod-tap key again. */ | 274 | /* Press and hold mod-tap key again. */ |
| 275 | EXPECT_NO_REPORT(driver); | 275 | EXPECT_NO_REPORT(driver); |
| 276 | mod_tap_key.press(); | 276 | mod_tap_key.press(); |
| 277 | run_one_scan_loop(); | 277 | run_one_scan_loop(); |
| 278 | testing::Mock::VerifyAndClearExpectations(&driver); | 278 | VERIFY_AND_CLEAR(driver); |
| 279 | 279 | ||
| 280 | /* Wait until tapping term expired */ | 280 | /* Wait until tapping term expired */ |
| 281 | EXPECT_REPORT(driver, (KC_LSFT)); | 281 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 282 | idle_for(TAPPING_TERM); | 282 | idle_for(TAPPING_TERM); |
| 283 | testing::Mock::VerifyAndClearExpectations(&driver); | 283 | VERIFY_AND_CLEAR(driver); |
| 284 | 284 | ||
| 285 | /* Release mod-tap key. */ | 285 | /* Release mod-tap key. */ |
| 286 | EXPECT_EMPTY_REPORT(driver); | 286 | EXPECT_EMPTY_REPORT(driver); |
| 287 | mod_tap_key.release(); | 287 | mod_tap_key.release(); |
| 288 | run_one_scan_loop(); | 288 | run_one_scan_loop(); |
| 289 | testing::Mock::VerifyAndClearExpectations(&driver); | 289 | VERIFY_AND_CLEAR(driver); |
| 290 | } | 290 | } |
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) { | |||
| 38 | EXPECT_NO_REPORT(driver); | 38 | EXPECT_NO_REPORT(driver); |
| 39 | mod_tap_hold_key.press(); | 39 | mod_tap_hold_key.press(); |
| 40 | idle_for(TAPPING_TERM); | 40 | idle_for(TAPPING_TERM); |
| 41 | testing::Mock::VerifyAndClearExpectations(&driver); | 41 | VERIFY_AND_CLEAR(driver); |
| 42 | 42 | ||
| 43 | /* Release mod-tap-hold key. */ | 43 | /* Release mod-tap-hold key. */ |
| 44 | /* TODO: Why is LSHIFT send at all? */ | 44 | /* TODO: Why is LSHIFT send at all? */ |
| @@ -48,5 +48,5 @@ TEST_F(RetroTapping, tap_and_hold_mod_tap_hold_key) { | |||
| 48 | EXPECT_EMPTY_REPORT(driver); | 48 | EXPECT_EMPTY_REPORT(driver); |
| 49 | mod_tap_hold_key.release(); | 49 | mod_tap_hold_key.release(); |
| 50 | run_one_scan_loop(); | 50 | run_one_scan_loop(); |
| 51 | testing::Mock::VerifyAndClearExpectations(&driver); | 51 | VERIFY_AND_CLEAR(driver); |
| 52 | } | 52 | } |
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) { | |||
| 35 | EXPECT_NO_REPORT(driver); | 35 | EXPECT_NO_REPORT(driver); |
| 36 | mod_tap_hold_key.press(); | 36 | mod_tap_hold_key.press(); |
| 37 | idle_for(TAPPING_TERM); | 37 | idle_for(TAPPING_TERM); |
| 38 | testing::Mock::VerifyAndClearExpectations(&driver); | 38 | VERIFY_AND_CLEAR(driver); |
| 39 | 39 | ||
| 40 | EXPECT_REPORT(driver, (KC_LSFT)); | 40 | EXPECT_REPORT(driver, (KC_LSFT)); |
| 41 | run_one_scan_loop(); | 41 | run_one_scan_loop(); |
| 42 | testing::Mock::VerifyAndClearExpectations(&driver); | 42 | VERIFY_AND_CLEAR(driver); |
| 43 | 43 | ||
| 44 | EXPECT_EMPTY_REPORT(driver); | 44 | EXPECT_EMPTY_REPORT(driver); |
| 45 | EXPECT_REPORT(driver, (KC_P)); | 45 | EXPECT_REPORT(driver, (KC_P)); |
| 46 | EXPECT_EMPTY_REPORT(driver); | 46 | EXPECT_EMPTY_REPORT(driver); |
| 47 | mod_tap_hold_key.release(); | 47 | mod_tap_hold_key.release(); |
| 48 | run_one_scan_loop(); | 48 | run_one_scan_loop(); |
| 49 | testing::Mock::VerifyAndClearExpectations(&driver); | 49 | VERIFY_AND_CLEAR(driver); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { | 52 | TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { |
| @@ -60,45 +60,45 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { | |||
| 60 | EXPECT_NO_REPORT(driver); | 60 | EXPECT_NO_REPORT(driver); |
| 61 | key_shift_hold_p_tap.press(); | 61 | key_shift_hold_p_tap.press(); |
| 62 | run_one_scan_loop(); | 62 | run_one_scan_loop(); |
| 63 | testing::Mock::VerifyAndClearExpectations(&driver); | 63 | VERIFY_AND_CLEAR(driver); |
| 64 | 64 | ||
| 65 | /* Release mod_tap_hold key */ | 65 | /* Release mod_tap_hold key */ |
| 66 | EXPECT_REPORT(driver, (KC_P)); | 66 | EXPECT_REPORT(driver, (KC_P)); |
| 67 | EXPECT_EMPTY_REPORT(driver); | 67 | EXPECT_EMPTY_REPORT(driver); |
| 68 | key_shift_hold_p_tap.release(); | 68 | key_shift_hold_p_tap.release(); |
| 69 | run_one_scan_loop(); | 69 | run_one_scan_loop(); |
| 70 | testing::Mock::VerifyAndClearExpectations(&driver); | 70 | VERIFY_AND_CLEAR(driver); |
| 71 | 71 | ||
| 72 | /* Press mod_tap_hold key again */ | 72 | /* Press mod_tap_hold key again */ |
| 73 | EXPECT_REPORT(driver, (KC_P)); | 73 | EXPECT_REPORT(driver, (KC_P)); |
| 74 | key_shift_hold_p_tap.press(); | 74 | key_shift_hold_p_tap.press(); |
| 75 | run_one_scan_loop(); | 75 | run_one_scan_loop(); |
| 76 | testing::Mock::VerifyAndClearExpectations(&driver); | 76 | VERIFY_AND_CLEAR(driver); |
| 77 | 77 | ||
| 78 | /* Release mod_tap_hold key again */ | 78 | /* Release mod_tap_hold key again */ |
| 79 | EXPECT_EMPTY_REPORT(driver); | 79 | EXPECT_EMPTY_REPORT(driver); |
| 80 | key_shift_hold_p_tap.release(); | 80 | key_shift_hold_p_tap.release(); |
| 81 | idle_for(TAPPING_TERM + 1); | 81 | idle_for(TAPPING_TERM + 1); |
| 82 | testing::Mock::VerifyAndClearExpectations(&driver); | 82 | VERIFY_AND_CLEAR(driver); |
| 83 | 83 | ||
| 84 | /* Press mod_tap_hold key again */ | 84 | /* Press mod_tap_hold key again */ |
| 85 | EXPECT_NO_REPORT(driver); | 85 | EXPECT_NO_REPORT(driver); |
| 86 | key_shift_hold_p_tap.press(); | 86 | key_shift_hold_p_tap.press(); |
| 87 | run_one_scan_loop(); | 87 | run_one_scan_loop(); |
| 88 | testing::Mock::VerifyAndClearExpectations(&driver); | 88 | VERIFY_AND_CLEAR(driver); |
| 89 | 89 | ||
| 90 | /* Release mod_tap_hold key again */ | 90 | /* Release mod_tap_hold key again */ |
| 91 | EXPECT_REPORT(driver, (KC_P)); | 91 | EXPECT_REPORT(driver, (KC_P)); |
| 92 | EXPECT_EMPTY_REPORT(driver); | 92 | EXPECT_EMPTY_REPORT(driver); |
| 93 | key_shift_hold_p_tap.release(); | 93 | key_shift_hold_p_tap.release(); |
| 94 | idle_for(TAPPING_TERM + 1); | 94 | idle_for(TAPPING_TERM + 1); |
| 95 | testing::Mock::VerifyAndClearExpectations(&driver); | 95 | VERIFY_AND_CLEAR(driver); |
| 96 | 96 | ||
| 97 | /* Press mod_tap_hold key again */ | 97 | /* Press mod_tap_hold key again */ |
| 98 | EXPECT_NO_REPORT(driver); | 98 | EXPECT_NO_REPORT(driver); |
| 99 | key_shift_hold_p_tap.press(); | 99 | key_shift_hold_p_tap.press(); |
| 100 | idle_for(TAPPING_TERM); | 100 | idle_for(TAPPING_TERM); |
| 101 | testing::Mock::VerifyAndClearExpectations(&driver); | 101 | VERIFY_AND_CLEAR(driver); |
| 102 | 102 | ||
| 103 | /* Release mod_tap_hold key again */ | 103 | /* Release mod_tap_hold key again */ |
| 104 | /* TODO: Why is KC_LSFT send? */ | 104 | /* TODO: Why is KC_LSFT send? */ |
| @@ -108,5 +108,5 @@ TEST_F(Tapping, ANewTapWithinTappingTermIsBuggy) { | |||
| 108 | EXPECT_EMPTY_REPORT(driver); | 108 | EXPECT_EMPTY_REPORT(driver); |
| 109 | key_shift_hold_p_tap.release(); | 109 | key_shift_hold_p_tap.release(); |
| 110 | run_one_scan_loop(); | 110 | run_one_scan_loop(); |
| 111 | testing::Mock::VerifyAndClearExpectations(&driver); | 111 | VERIFY_AND_CLEAR(driver); |
| 112 | } | 112 | } |
diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp index 982aec6c83..8d09e44840 100644 --- a/tests/test_common/test_driver.hpp +++ b/tests/test_common/test_driver.hpp | |||
| @@ -98,6 +98,12 @@ class TestDriver { | |||
| 98 | */ | 98 | */ |
| 99 | #define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0) | 99 | #define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0) |
| 100 | 100 | ||
| 101 | /** | ||
| 102 | * @brief Verify and clear all gmock expectations that have been setup until | ||
| 103 | * this point. | ||
| 104 | */ | ||
| 105 | #define VERIFY_AND_CLEAR(driver) testing::Mock::VerifyAndClearExpectations(&driver) | ||
| 106 | |||
| 101 | namespace internal { | 107 | namespace internal { |
| 102 | void expect_unicode_code_point(TestDriver& driver, uint32_t code_point); | 108 | void expect_unicode_code_point(TestDriver& driver, uint32_t code_point); |
| 103 | } // namespace internal | 109 | } // namespace internal |
diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp index 5dc5db1848..76daa625ad 100644 --- a/tests/test_common/test_fixture.cpp +++ b/tests/test_common/test_fixture.cpp | |||
| @@ -82,12 +82,12 @@ TestFixture::~TestFixture() { | |||
| 82 | #endif | 82 | #endif |
| 83 | 83 | ||
| 84 | idle_for(TAPPING_TERM * 10); | 84 | idle_for(TAPPING_TERM * 10); |
| 85 | testing::Mock::VerifyAndClearExpectations(&driver); | 85 | VERIFY_AND_CLEAR(driver); |
| 86 | 86 | ||
| 87 | /* Verify that the matrix really is cleared */ | 87 | /* Verify that the matrix really is cleared */ |
| 88 | EXPECT_NO_REPORT(driver); | 88 | EXPECT_NO_REPORT(driver); |
| 89 | idle_for(TAPPING_TERM * 10); | 89 | idle_for(TAPPING_TERM * 10); |
| 90 | testing::Mock::VerifyAndClearExpectations(&driver); | 90 | VERIFY_AND_CLEAR(driver); |
| 91 | m_this = nullptr; | 91 | m_this = nullptr; |
| 92 | 92 | ||
| 93 | test_logger.info() << "test fixture clean-up end." << std::endl; | 93 | test_logger.info() << "test fixture clean-up end." << std::endl; |
