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
21 changed files with 257 additions and 251 deletions

View File

@@ -66,17 +66,17 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) {
run_one_scan_loop();
expect_layer_state(0);
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
EXPECT_REPORT(driver, (KC_A)).Times(1);
regular_key.press();
run_one_scan_loop();
expect_layer_state(0);
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
EXPECT_EMPTY_REPORT(driver).Times(1);
regular_key.release();
run_one_scan_loop();
expect_layer_state(0);
testing::Mock::VerifyAndClearExpectations(&driver);
VERIFY_AND_CLEAR(driver);
}