diff options
author | Nick Brassel <nick@tzarc.org> | 2023-02-28 11:22:29 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2023-02-28 11:22:29 +1100 |
commit | bacec14073b2e897d5a52caf12de5a6a1f7b4078 (patch) | |
tree | d4e3e57aac1a829a191831efd2e62c8a43217885 /tests/basic/test_keypress.cpp | |
parent | d70e9b8659a7fbbd7069fd542bd07e67e04327a1 (diff) | |
parent | b865b9e1706ad28ae4882bd2e0331e98808295fa (diff) |
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'tests/basic/test_keypress.cpp')
-rw-r--r-- | tests/basic/test_keypress.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
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) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_REPORT(driver, (key_eql.report_code)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { @@ -206,24 +206,24 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.press(); EXPECT_EMPTY_REPORT(driver); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); // BUG: Should really still return KC_EQUAL, but this is fine too EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_NO_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { @@ -237,24 +237,24 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { @@ -268,7 +268,7 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { key_eql.press(); EXPECT_REPORT(driver, (KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.press(); // BUG: The sequence is a bit strange, but it works, the end result is that @@ -277,16 +277,16 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) { EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); EXPECT_REPORT(driver, (KC_LEFT_SHIFT, KC_EQUAL)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_eql.release(); // I guess it's fine to still report shift here EXPECT_REPORT(driver, (KC_LEFT_SHIFT)); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); key_plus.release(); EXPECT_EMPTY_REPORT(driver); run_one_scan_loop(); - testing::Mock::VerifyAndClearExpectations(&driver); + VERIFY_AND_CLEAR(driver); } |