mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[hal,wpilib] Rename "Test" robot mode to "Utility" (#8782)
The "Utility" name better matches its intended generic use case and avoids overloaded terminology with unit testing (e.g. the need to name the opmode annotation `@TestOpMode`). The driver station will also be updated to reflect this change.
This commit is contained in:
@@ -33,7 +33,7 @@ public final class MockHardwareExtension implements BeforeAllCallback {
|
||||
HAL.initialize(500, 0);
|
||||
DriverStationSim.setDsAttached(true);
|
||||
DriverStationSim.setEnabled(true);
|
||||
DriverStationSim.setRobotMode(RobotMode.TEST);
|
||||
DriverStationSim.setRobotMode(RobotMode.UTILITY);
|
||||
DriverStationSim.notifyNewData();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ class RobotModeTriggersTest extends CommandTestBase {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testModeTest() {
|
||||
void utilityTest() {
|
||||
DriverStationSim.resetData();
|
||||
DriverStationSim.setRobotMode(RobotMode.TEST);
|
||||
DriverStationSim.setRobotMode(RobotMode.UTILITY);
|
||||
DriverStationSim.setEnabled(true);
|
||||
DriverStationSim.notifyNewData();
|
||||
Trigger test = RobotModeTriggers.test();
|
||||
Trigger test = RobotModeTriggers.utility();
|
||||
assertTrue(test.getAsBoolean());
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ TEST(RobotModeTriggersTest, Disabled) {
|
||||
EXPECT_TRUE(disabled.Get());
|
||||
}
|
||||
|
||||
TEST(RobotModeTriggersTest, TestMode) {
|
||||
TEST(RobotModeTriggersTest, UtilityMode) {
|
||||
DriverStationSim::ResetData();
|
||||
DriverStationSim::SetRobotMode(HAL_ROBOT_MODE_TEST);
|
||||
DriverStationSim::SetRobotMode(HAL_ROBOT_MODE_UTILITY);
|
||||
DriverStationSim::SetEnabled(true);
|
||||
DriverStationSim::NotifyNewData();
|
||||
Trigger test = RobotModeTriggers::Test();
|
||||
Trigger test = RobotModeTriggers::Utility();
|
||||
EXPECT_TRUE(test.Get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user