summaryrefslogtreecommitdiffstats
path: root/tests/basic/test_keypress.cpp
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-11-04 16:22:17 +1100
committerGitHub <noreply@github.com>2021-11-03 22:22:17 -0700
commitf529580860cf5a1de4afc10432f218a45daae17a (patch)
tree1d2fa041174f2586230ab831c05e5b56d8ba4f92 /tests/basic/test_keypress.cpp
parentb06d9d822cfb72e0728b11711a333f2f5d3c631e (diff)
Basic keycode overhaul (#14726)
Diffstat (limited to 'tests/basic/test_keypress.cpp')
-rw-r--r--tests/basic/test_keypress.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/tests/basic/test_keypress.cpp b/tests/basic/test_keypress.cpp
index ecd6e98e44..cf839f8c16 100644
--- a/tests/basic/test_keypress.cpp
+++ b/tests/basic/test_keypress.cpp
@@ -73,10 +73,10 @@ TEST_F(KeyPress, LeftShiftIsReportedCorrectly) {
// See issue #1476 for more information
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A)));
keyboard_task();
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A, KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_A, KC_LEFT_SHIFT)));
keyboard_task();
release_key(0, 0);
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
keyboard_task();
release_key(3, 0);
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
@@ -89,9 +89,9 @@ TEST_F(KeyPress, PressLeftShiftAndControl) {
press_key(5, 0);
// Unfortunately modifiers are also processed in the wrong order
// See issue #1476 for more information
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
keyboard_task();
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_LCTRL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_LEFT_CTRL)));
keyboard_task();
}
@@ -101,9 +101,9 @@ TEST_F(KeyPress, LeftAndRightShiftCanBePressedAtTheSameTime) {
press_key(4, 0);
// Unfortunately modifiers are also processed in the wrong order
// See issue #1476 for more information
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
keyboard_task();
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_RSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_RIGHT_SHIFT)));
keyboard_task();
}
@@ -115,11 +115,11 @@ TEST_F(KeyPress, RightShiftLeftControlAndCharWithTheSameKey) {
// See issue #524 for more information
// The underlying cause is that we use only one bit to represent the right hand
// modifiers.
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL, KC_O)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL, KC_O)));
keyboard_task();
release_key(6, 0);
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RIGHT_SHIFT, KC_RIGHT_CTRL)));
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
keyboard_task();
}
@@ -129,23 +129,23 @@ TEST_F(KeyPress, PressPlusEqualReleaseBeforePress) {
InSequence s;
press_key(1, 1); // KC_PLUS
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
release_key(1, 1); // KC_PLUS
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- press_key(0, 1); // KC_EQL
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
+ press_key(0, 1); // KC_EQUAL
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- release_key(0, 1); // KC_EQL
+ release_key(0, 1); // KC_EQUAL
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
@@ -156,25 +156,25 @@ TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) {
InSequence s;
press_key(1, 1); // KC_PLUS
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- press_key(0, 1); // KC_EQL
+ press_key(0, 1); // KC_EQUAL
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- release_key(1, 1); // KC_PLS
- // BUG: Should really still return KC_EQL, but this is fine too
+ release_key(1, 1); // KC_PLUS
+ // BUG: Should really still return KC_EQUAL, but this is fine too
// It's also called twice for some reason
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2);
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- release_key(0, 1); // KC_EQL
+ release_key(0, 1); // KC_EQUAL
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
@@ -184,24 +184,24 @@ TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) {
TestDriver driver;
InSequence s;
- press_key(0, 1); // KC_EQL
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
+ press_key(0, 1); // KC_EQUAL
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- release_key(0, 1); // KQ_EQL
+ release_key(0, 1); // KC_EQUAL
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
press_key(1, 1); // KC_PLUS
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
release_key(1, 1); // KC_PLUS
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
@@ -211,29 +211,29 @@ TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) {
TestDriver driver;
InSequence s;
- press_key(0, 1); // KC_EQL
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
+ press_key(0, 1); // KC_EQUAL
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
press_key(1, 1); // KC_PLUS
// BUG: The sequence is a bit strange, but it works, the end result is that
// KC_PLUS is sent
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT, KC_EQUAL)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
- release_key(0, 1); // KC_EQL
+ release_key(0, 1); // KC_EQUAL
// I guess it's fine to still report shift here
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);
release_key(1, 1); // KC_PLUS
// This report is not needed
- EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
+ EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LEFT_SHIFT)));
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
run_one_scan_loop();
testing::Mock::VerifyAndClearExpectations(&driver);