[hal] Fix unfinished/incorrect GetCPUTemp functions (#5598)

This commit is contained in:
Ryan Blue
2023-08-31 14:51:57 -04:00
committed by GitHub
parent 99f66b1e24
commit b2dd59450b
11 changed files with 171 additions and 6 deletions

View File

@@ -209,6 +209,23 @@ class RoboRioSimTest {
}
}
@Test
void testCPUTemp() {
RoboRioSim.resetData();
DoubleCallback callback = new DoubleCallback();
try (CallbackStore cb = RoboRioSim.registerCPUTempCallback(callback, false)) {
final double kCPUTemp = 100.0;
RoboRioSim.setCPUTemp(kCPUTemp);
assertTrue(callback.wasTriggered());
assertEquals(kCPUTemp, callback.getSetValue());
assertEquals(kCPUTemp, RoboRioSim.getCPUTemp());
assertEquals(kCPUTemp, RobotController.getCPUTemp());
}
}
@Test
void testSerialNumber() {
RoboRioSim.resetData();