diff --git a/wpimath/src/test/java/edu/wpi/first/math/controller/PIDInputOutputTest.java b/wpimath/src/test/java/edu/wpi/first/math/controller/PIDInputOutputTest.java index 7bda5699ffe..d464057cb79 100644 --- a/wpimath/src/test/java/edu/wpi/first/math/controller/PIDInputOutputTest.java +++ b/wpimath/src/test/java/edu/wpi/first/math/controller/PIDInputOutputTest.java @@ -57,16 +57,4 @@ void derivativeGainOutputTest() { assertEquals(-0.01 / m_controller.getPeriod(), m_controller.calculate(0.0025, 0), 1e-5); } - - @Test - void atSetpointTest() { - m_controller.reset(); - assertFalse(m_controller.atSetpoint()); - m_controller.setTolerance(2); - assertFalse(m_controller.atSetpoint()); - m_controller.setSetpoint(0); - assertFalse(m_controller.atSetpoint()); - m_controller.calculate(0); - assertTrue(m_controller.atSetpoint()); - } } diff --git a/wpimath/src/test/java/edu/wpi/first/math/controller/PIDToleranceTest.java b/wpimath/src/test/java/edu/wpi/first/math/controller/PIDToleranceTest.java index b525f49e0f5..4fdb8670b39 100644 --- a/wpimath/src/test/java/edu/wpi/first/math/controller/PIDToleranceTest.java +++ b/wpimath/src/test/java/edu/wpi/first/math/controller/PIDToleranceTest.java @@ -19,7 +19,7 @@ void initialToleranceTest() { try (var controller = new PIDController(0.05, 0.0, 0.0)) { controller.enableContinuousInput(-kRange / 2, kRange / 2); - assertTrue(controller.atSetpoint()); + assertFalse(controller.atSetpoint()); } } @@ -28,10 +28,7 @@ void absoluteToleranceTest() { try (var controller = new PIDController(0.05, 0.0, 0.0)) { controller.enableContinuousInput(-kRange / 2, kRange / 2); - assertTrue( - controller.atSetpoint(), - "Error was not in tolerance when it should have been. Error was " - + controller.getPositionError()); + assertFalse(controller.atSetpoint()); controller.setTolerance(kTolerance); controller.setSetpoint(kSetpoint);