mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Add way to silence joystick connection warnings (#2845)
Warnings cannot be silenced when connected to FMS.
This commit is contained in:
committed by
GitHub
parent
7a73946ce1
commit
2ef67f20a7
@@ -41,4 +41,23 @@ class DriverStationTest {
|
||||
arguments(4, 10, 1, true)
|
||||
);
|
||||
}
|
||||
|
||||
@MethodSource("connectionWarningProvider")
|
||||
void testConnectionWarnings(boolean fms, boolean silence, boolean expected) {
|
||||
DriverStationSim.setFmsAttached(fms);
|
||||
DriverStationSim.notifyNewData();
|
||||
|
||||
DriverStation.getInstance().silenceJoystickConnectionWarning(silence);
|
||||
assertEquals(expected,
|
||||
DriverStation.getInstance().isJoystickConnectionWarningSilenced());
|
||||
}
|
||||
|
||||
static Stream<Arguments> connectionWarningProvider() {
|
||||
return Stream.of(
|
||||
arguments(false, true, true),
|
||||
arguments(false, false, false),
|
||||
arguments(true, true, false),
|
||||
arguments(true, false, false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user