mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal] Fix unfinished/incorrect GetCPUTemp functions (#5598)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user