mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-06-03 14:13:46 -03:00
Add core handling for pointing device failures. (#25315)
This commit is contained in:
@@ -12,6 +12,26 @@ using testing::_;
|
||||
class Pointing : public TestFixture {};
|
||||
class PointingButtonsViaMousekeysParametrized : public ::testing::WithParamInterface<std::pair<KeymapKey, uint8_t>>, public Pointing {};
|
||||
|
||||
TEST_F(Pointing, NoMovementOnInitFailure) {
|
||||
TestDriver driver;
|
||||
|
||||
pointing_device_set_status(POINTING_DEVICE_STATUS_INIT_FAILED);
|
||||
pd_set_x(-50);
|
||||
pd_set_y(100);
|
||||
EXPECT_NO_MOUSE_REPORT(driver);
|
||||
run_one_scan_loop();
|
||||
|
||||
pointing_device_set_status(POINTING_DEVICE_STATUS_SUCCESS);
|
||||
EXPECT_MOUSE_REPORT(driver, (-50, 100, 0, 0, 0));
|
||||
run_one_scan_loop();
|
||||
|
||||
pd_clear_movement();
|
||||
// EXPECT_EMPTY_MOUSE_REPORT(driver);
|
||||
run_one_scan_loop();
|
||||
|
||||
VERIFY_AND_CLEAR(driver);
|
||||
}
|
||||
|
||||
TEST_F(Pointing, SendMouseIsNotCalledWithNoInput) {
|
||||
TestDriver driver;
|
||||
EXPECT_NO_MOUSE_REPORT(driver);
|
||||
|
||||
@@ -22,8 +22,9 @@ typedef struct {
|
||||
|
||||
static pd_config_t pd_config = {0};
|
||||
|
||||
void pointing_device_driver_init(void) {
|
||||
bool pointing_device_driver_init(void) {
|
||||
pd_set_init(true);
|
||||
return pd_config.initiated;
|
||||
}
|
||||
|
||||
report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) {
|
||||
|
||||
Reference in New Issue
Block a user