Introduce VERIFY_AND_CLEAR shorthand (#19370)

Which is just a syntactic sugar for
testing::Mock::VerifyAndClearExpectations to reduce the visual clutter
in unit-tests.
This commit is contained in:
Stefan Kerkmann 2022-12-18 21:55:14 +01:00 committed by GitHub
parent 7aa2d791f6
commit c2b13bd77b
Failed to generate hash of commit
21 changed files with 257 additions and 251 deletions

View file

@ -37,14 +37,14 @@ TEST_F(AutoShift, key_release_before_timeout) {
EXPECT_NO_REPORT(driver);
regular_key.press();
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
/* Release regular key */
EXPECT_REPORT(driver, (KC_A));
EXPECT_EMPTY_REPORT(driver);
regular_key.release();
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
}
TEST_F(AutoShift, key_release_after_timeout) {
@ -58,7 +58,7 @@ TEST_F(AutoShift, key_release_after_timeout) {
EXPECT_NO_REPORT(driver);
regular_key.press();
idle_for(AUTO_SHIFT_TIMEOUT);
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
/* Release regular key */
EXPECT_REPORT(driver, (KC_LSFT, KC_A));
@ -66,5 +66,5 @@ TEST_F(AutoShift, key_release_after_timeout) {
EXPECT_EMPTY_REPORT(driver);
regular_key.release();
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
}