[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:
Joseph Eng
2026-03-09 23:03:00 -07:00
committed by GitHub
parent c0f8159540
commit f196418297
5 changed files with 64 additions and 51 deletions

View File

@@ -43,9 +43,6 @@ public class Alert implements AutoCloseable {
*/
HIGH(AlertJNI.LEVEL_HIGH),
/** Alternate name for a high priority alert. */
ERROR(HIGH.m_value),
/**
* Medium priority alert - displayed second with a yellow "!" symbol. Use this type for problems
* which could affect the robot's functionality but do not necessarily require immediate
@@ -53,18 +50,21 @@ public class Alert implements AutoCloseable {
*/
MEDIUM(AlertJNI.LEVEL_MEDIUM),
/** Alternate name for a medium priority alert. */
WARNING(MEDIUM.m_value),
/**
* Low priority alert - displayed last with a green "i" symbol. Use this type for problems which
* are unlikely to affect the robot's functionality, or any other alerts which do not fall under
* the other categories.
*/
LOW(AlertJNI.LEVEL_LOW),
LOW(AlertJNI.LEVEL_LOW);
/** Alternate name for a high priority alert. */
public static final Level ERROR = HIGH;
/** Alternate name for a medium priority alert. */
public static final Level WARNING = MEDIUM;
/** Alternate name for a low priority alert. */
INFO(LOW.m_value);
public static final Level INFO = LOW;
private final int m_value;