mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilibj] Use try with resources for Java tests (#2612)
This commit is contained in:
@@ -29,12 +29,9 @@ public final class MockHardwareExtension implements BeforeAllCallback {
|
||||
|
||||
private void initializeHardware() {
|
||||
HAL.initialize(500, 0);
|
||||
DriverStationSim dsSim = new DriverStationSim();
|
||||
dsSim.setDsAttached(true);
|
||||
dsSim.setAutonomous(false);
|
||||
dsSim.setEnabled(true);
|
||||
dsSim.setTest(true);
|
||||
|
||||
|
||||
DriverStationSim.setDsAttached(true);
|
||||
DriverStationSim.setAutonomous(false);
|
||||
DriverStationSim.setEnabled(true);
|
||||
DriverStationSim.setTest(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -23,172 +23,163 @@ class WatchdogTest {
|
||||
void enableDisableTest() {
|
||||
final AtomicInteger watchdogCounter = new AtomicInteger(0);
|
||||
|
||||
final Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1));
|
||||
try (Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1))) {
|
||||
System.out.println("Run 1");
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
System.out.println("Run 1");
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
System.out.println("Run 2");
|
||||
watchdogCounter.set(0);
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(600);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
|
||||
// Run 3
|
||||
watchdogCounter.set(0);
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
System.out.println("Run 2");
|
||||
watchdogCounter.set(0);
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(600);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
|
||||
// Run 3
|
||||
watchdogCounter.set(0);
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
|
||||
watchdog.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void resetTest() {
|
||||
final AtomicInteger watchdogCounter = new AtomicInteger(0);
|
||||
|
||||
final Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1));
|
||||
try (Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1))) {
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.reset();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
}
|
||||
watchdog.reset();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
watchdog.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void setTimeoutTest() {
|
||||
final AtomicInteger watchdogCounter = new AtomicInteger(0);
|
||||
|
||||
final Watchdog watchdog = new Watchdog(1.0, () -> watchdogCounter.addAndGet(1));
|
||||
try (Watchdog watchdog = new Watchdog(1.0, () -> watchdogCounter.addAndGet(1))) {
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.setTimeout(0.2);
|
||||
|
||||
watchdog.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
assertEquals(0.2, watchdog.getTimeout());
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
}
|
||||
watchdog.setTimeout(0.2);
|
||||
|
||||
assertEquals(0.2, watchdog.getTimeout());
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
|
||||
watchdog.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isExpiredTest() {
|
||||
final Watchdog watchdog = new Watchdog(0.2, () -> {
|
||||
});
|
||||
assertFalse(watchdog.isExpired());
|
||||
watchdog.enable();
|
||||
try (Watchdog watchdog = new Watchdog(0.2, () -> {
|
||||
})) {
|
||||
assertFalse(watchdog.isExpired());
|
||||
watchdog.enable();
|
||||
|
||||
assertFalse(watchdog.isExpired());
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
assertFalse(watchdog.isExpired());
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
assertTrue(watchdog.isExpired());
|
||||
|
||||
watchdog.disable();
|
||||
assertTrue(watchdog.isExpired());
|
||||
|
||||
watchdog.reset();
|
||||
assertFalse(watchdog.isExpired());
|
||||
}
|
||||
assertTrue(watchdog.isExpired());
|
||||
|
||||
watchdog.disable();
|
||||
assertTrue(watchdog.isExpired());
|
||||
|
||||
watchdog.reset();
|
||||
assertFalse(watchdog.isExpired());
|
||||
|
||||
watchdog.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void epochsTest() {
|
||||
final AtomicInteger watchdogCounter = new AtomicInteger(0);
|
||||
|
||||
final Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1));
|
||||
try (Watchdog watchdog = new Watchdog(0.4, () -> watchdogCounter.addAndGet(1))) {
|
||||
System.out.println("Run 1");
|
||||
watchdog.enable();
|
||||
watchdog.addEpoch("Epoch 1");
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.addEpoch("Epoch 2");
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.addEpoch("Epoch 3");
|
||||
watchdog.disable();
|
||||
|
||||
System.out.println("Run 1");
|
||||
watchdog.enable();
|
||||
watchdog.addEpoch("Epoch 1");
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
System.out.println("Run 2");
|
||||
watchdog.enable();
|
||||
watchdog.addEpoch("Epoch 1");
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.reset();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.addEpoch("Epoch 2");
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
}
|
||||
watchdog.addEpoch("Epoch 2");
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.addEpoch("Epoch 3");
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
System.out.println("Run 2");
|
||||
watchdog.enable();
|
||||
watchdog.addEpoch("Epoch 1");
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.reset();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog.addEpoch("Epoch 2");
|
||||
watchdog.disable();
|
||||
|
||||
assertEquals(0, watchdogCounter.get(), "Watchdog triggered early");
|
||||
|
||||
watchdog.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -196,33 +187,30 @@ class WatchdogTest {
|
||||
final AtomicInteger watchdogCounter1 = new AtomicInteger(0);
|
||||
final AtomicInteger watchdogCounter2 = new AtomicInteger(0);
|
||||
|
||||
final Watchdog watchdog1 = new Watchdog(0.2, () -> watchdogCounter1.addAndGet(1));
|
||||
final Watchdog watchdog2 = new Watchdog(0.6, () -> watchdogCounter2.addAndGet(1));
|
||||
try (Watchdog watchdog1 = new Watchdog(0.2, () -> watchdogCounter1.addAndGet(1));
|
||||
Watchdog watchdog2 = new Watchdog(0.6, () -> watchdogCounter2.addAndGet(1))) {
|
||||
watchdog2.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
assertEquals(0, watchdogCounter1.get(), "Watchdog triggered early");
|
||||
assertEquals(0, watchdogCounter2.get(), "Watchdog triggered early");
|
||||
|
||||
watchdog2.enable();
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
// Sleep enough such that only the watchdog enabled later times out first
|
||||
watchdog1.enable();
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog1.disable();
|
||||
watchdog2.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter1.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
assertEquals(0, watchdogCounter2.get(), "Watchdog triggered early");
|
||||
}
|
||||
assertEquals(0, watchdogCounter1.get(), "Watchdog triggered early");
|
||||
assertEquals(0, watchdogCounter2.get(), "Watchdog triggered early");
|
||||
|
||||
// Sleep enough such that only the watchdog enabled later times out first
|
||||
watchdog1.enable();
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
watchdog1.disable();
|
||||
watchdog2.disable();
|
||||
|
||||
assertEquals(1, watchdogCounter1.get(),
|
||||
"Watchdog either didn't trigger or triggered more than once");
|
||||
assertEquals(0, watchdogCounter2.get(), "Watchdog triggered early");
|
||||
|
||||
watchdog1.close();
|
||||
watchdog2.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -19,36 +19,38 @@ class PIDToleranceTest {
|
||||
|
||||
@Test
|
||||
void initialToleranceTest() {
|
||||
var controller = new PIDController(0.05, 0.0, 0.0);
|
||||
controller.enableContinuousInput(-kRange / 2, kRange / 2);
|
||||
try (var controller = new PIDController(0.05, 0.0, 0.0)) {
|
||||
controller.enableContinuousInput(-kRange / 2, kRange / 2);
|
||||
|
||||
assertTrue(controller.atSetpoint());
|
||||
assertTrue(controller.atSetpoint());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void absoluteToleranceTest() {
|
||||
var controller = new PIDController(0.05, 0.0, 0.0);
|
||||
controller.enableContinuousInput(-kRange / 2, kRange / 2);
|
||||
try (var controller = new PIDController(0.05, 0.0, 0.0)) {
|
||||
controller.enableContinuousInput(-kRange / 2, kRange / 2);
|
||||
|
||||
controller.setTolerance(kTolerance);
|
||||
controller.setSetpoint(kSetpoint);
|
||||
controller.setTolerance(kTolerance);
|
||||
controller.setSetpoint(kSetpoint);
|
||||
|
||||
controller.calculate(0.0);
|
||||
controller.calculate(0.0);
|
||||
|
||||
assertFalse(controller.atSetpoint(),
|
||||
"Error was in tolerance when it should not have been. Error was " + controller
|
||||
.getPositionError());
|
||||
assertFalse(controller.atSetpoint(),
|
||||
"Error was in tolerance when it should not have been. Error was "
|
||||
+ controller.getPositionError());
|
||||
|
||||
controller.calculate(kSetpoint + kTolerance / 2);
|
||||
controller.calculate(kSetpoint + kTolerance / 2);
|
||||
|
||||
assertTrue(controller.atSetpoint(),
|
||||
"Error was not in tolerance when it should have been. Error was " + controller
|
||||
.getPositionError());
|
||||
assertTrue(controller.atSetpoint(),
|
||||
"Error was not in tolerance when it should have been. Error was "
|
||||
+ controller.getPositionError());
|
||||
|
||||
controller.calculate(kSetpoint + 10 * kTolerance);
|
||||
controller.calculate(kSetpoint + 10 * kTolerance);
|
||||
|
||||
assertFalse(controller.atSetpoint(),
|
||||
"Error was in tolerance when it should not have been. Error was " + controller
|
||||
.getPositionError());
|
||||
assertFalse(controller.atSetpoint(),
|
||||
"Error was in tolerance when it should not have been. Error was "
|
||||
+ controller.getPositionError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,21 +25,18 @@ class AnalogInputSimTest {
|
||||
void setCallbackTest() {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
AnalogInput input = new AnalogInput(5);
|
||||
AnalogInputSim inputSim = new AnalogInputSim(input);
|
||||
try (AnalogInput input = new AnalogInput(5)) {
|
||||
AnalogInputSim inputSim = new AnalogInputSim(input);
|
||||
|
||||
for (double i = 0; i < 5.0; i += 0.1) {
|
||||
inputSim.setVoltage(0);
|
||||
for (double i = 0; i < 5.0; i += 0.1) {
|
||||
inputSim.setVoltage(0);
|
||||
|
||||
assertEquals(input.getVoltage(), 0, 0.001);
|
||||
assertEquals(input.getVoltage(), 0, 0.001);
|
||||
|
||||
inputSim.setVoltage(i);
|
||||
|
||||
assertEquals(input.getVoltage(), i, 0.001);
|
||||
inputSim.setVoltage(i);
|
||||
|
||||
assertEquals(input.getVoltage(), i, 0.001);
|
||||
}
|
||||
}
|
||||
|
||||
input.close();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,38 +34,36 @@ class AnalogOutputSimTest {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
|
||||
AnalogOutput output = new AnalogOutput(0);
|
||||
output.setVoltage(0.5);
|
||||
try (AnalogOutput output = new AnalogOutput(0)) {
|
||||
output.setVoltage(0.5);
|
||||
|
||||
AnalogOutputSim outputSim = new AnalogOutputSim(output);
|
||||
AnalogOutputSim outputSim = new AnalogOutputSim(output);
|
||||
|
||||
DoubleStore store = new DoubleStore();
|
||||
DoubleStore store = new DoubleStore();
|
||||
|
||||
try (CallbackStore cb = outputSim.registerVoltageCallback((name, value) -> {
|
||||
store.m_wasTriggered = true;
|
||||
store.m_wasCorrectType = true;
|
||||
store.m_setValue = value.getDouble();
|
||||
}, false)) {
|
||||
assertFalse(store.m_wasTriggered);
|
||||
try (CallbackStore cb = outputSim.registerVoltageCallback((name, value) -> {
|
||||
store.m_wasTriggered = true;
|
||||
store.m_wasCorrectType = true;
|
||||
store.m_setValue = value.getDouble();
|
||||
}, false)) {
|
||||
assertFalse(store.m_wasTriggered);
|
||||
|
||||
for (double i = 0.1; i < 5.0; i += 0.1) {
|
||||
store.reset();
|
||||
for (double i = 0.1; i < 5.0; i += 0.1) {
|
||||
store.reset();
|
||||
|
||||
output.setVoltage(0);
|
||||
output.setVoltage(0);
|
||||
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, 0, 0.001);
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, 0, 0.001);
|
||||
|
||||
store.reset();
|
||||
store.reset();
|
||||
|
||||
output.setVoltage(i);
|
||||
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, i, 0.001);
|
||||
output.setVoltage(i);
|
||||
|
||||
assertTrue(store.m_wasTriggered);
|
||||
assertEquals(store.m_setValue, i, 0.001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class CubicHermiteSplineTest {
|
||||
@SuppressWarnings({"ParameterName", "PMD.UnusedLocalVariable"})
|
||||
private void run(Pose2d a, List<Translation2d> waypoints, Pose2d b) {
|
||||
// Start the timer.
|
||||
var start = System.nanoTime();
|
||||
//var start = System.nanoTime();
|
||||
|
||||
// Generate and parameterize the spline.
|
||||
var controlVectors =
|
||||
@@ -51,10 +51,10 @@ class CubicHermiteSplineTest {
|
||||
}
|
||||
|
||||
// End the timer.
|
||||
var end = System.nanoTime();
|
||||
//var end = System.nanoTime();
|
||||
|
||||
// Calculate the duration (used when benchmarking)
|
||||
var durationMicroseconds = (end - start) / 1000.0;
|
||||
//var durationMicroseconds = (end - start) / 1000.0;
|
||||
|
||||
for (int i = 0; i < poses.size() - 1; i++) {
|
||||
var p0 = poses.get(i);
|
||||
|
||||
@@ -28,7 +28,7 @@ class QuinticHermiteSplineTest {
|
||||
@SuppressWarnings({ "ParameterName", "PMD.UnusedLocalVariable" })
|
||||
private void run(Pose2d a, Pose2d b) {
|
||||
// Start the timer.
|
||||
var start = System.nanoTime();
|
||||
//var start = System.nanoTime();
|
||||
|
||||
// Generate and parameterize the spline.
|
||||
var controlVectors = SplineHelper.getQuinticControlVectorsFromWaypoints(List.of(a, b));
|
||||
@@ -37,10 +37,10 @@ class QuinticHermiteSplineTest {
|
||||
var poses = SplineParameterizer.parameterize(spline);
|
||||
|
||||
// End the timer.
|
||||
var end = System.nanoTime();
|
||||
//var end = System.nanoTime();
|
||||
|
||||
// Calculate the duration (used when benchmarking)
|
||||
var durationMicroseconds = (end - start) / 1000.0;
|
||||
//var durationMicroseconds = (end - start) / 1000.0;
|
||||
|
||||
for (int i = 0; i < poses.size() - 1; i++) {
|
||||
var p0 = poses.get(i);
|
||||
|
||||
@@ -75,8 +75,7 @@ class TrajectoryGeneratorTest {
|
||||
|
||||
@Test
|
||||
void testMalformedTrajectory() {
|
||||
var dsSim = new DriverStationSim();
|
||||
dsSim.setSendError(false);
|
||||
DriverStationSim.setSendError(false);
|
||||
|
||||
var traj =
|
||||
TrajectoryGenerator.generateTrajectory(
|
||||
@@ -90,6 +89,6 @@ class TrajectoryGeneratorTest {
|
||||
assertEquals(traj.getStates().size(), 1);
|
||||
assertEquals(traj.getTotalTimeSeconds(), 0);
|
||||
|
||||
dsSim.setSendError(true);
|
||||
DriverStationSim.setSendError(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user