mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Fixup alerts (#8663)
Makes Java `Alert.Level.ERROR`, `Alert.Level.WARNING`, and `Alert.Level.INFO` proper aliases (instead of separate enum constants with the same value). Cleans up Python tests. Makes the Alert tests more consistent between languages.
This commit is contained in:
@@ -54,19 +54,20 @@ class AlertSimTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testInitialization() {
|
||||
void testNoAlertsInitially() {
|
||||
assertEquals(0, AlertSim.getCount());
|
||||
assertEquals(0, AlertSim.getAll().length);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testReset() {
|
||||
void testNoAlertsAfterReset() {
|
||||
try (var alert = makeAlert("alert", Level.HIGH)) {
|
||||
alert.set(true);
|
||||
assertTrue(isAlertActive("alert", Level.HIGH));
|
||||
AlertSim.resetData();
|
||||
assertEquals(0, AlertSim.getCount());
|
||||
assertEquals(0, AlertSim.getAll().length);
|
||||
}
|
||||
AlertSim.resetData();
|
||||
assertFalse(isAlertActive("alert", Level.HIGH));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -109,6 +110,7 @@ class AlertSimTest {
|
||||
c.set(true);
|
||||
|
||||
var startState = List.of(getActiveAlerts(Level.LOW));
|
||||
assertEquals(List.of("A", "B", "C"), startState);
|
||||
|
||||
b.set(true);
|
||||
assertState(Level.LOW, startState);
|
||||
|
||||
Reference in New Issue
Block a user