mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Merge "More updates to the Gyro test fixing potential null pointer exception"
This commit is contained in:
@@ -100,7 +100,7 @@ public class GyroTest extends AbstractComsSetup {
|
||||
assertEquals(errorMessage(angle, 0), 0, angle, .5);
|
||||
Timer.delay(5);
|
||||
angle = gyro.getAngle();
|
||||
assertEquals("After 5 seconds " + errorMessage(angle, 0), 0, angle, 1);
|
||||
assertEquals("After 5 seconds " + errorMessage(angle, 0), 0, angle, 2.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,6 +65,7 @@ public abstract class TiltPanCameraFixture implements ITestFixture {
|
||||
|
||||
@Override
|
||||
public boolean reset() {
|
||||
if(gyro != null)
|
||||
gyro.reset();
|
||||
return true;
|
||||
}
|
||||
@@ -101,8 +102,14 @@ public abstract class TiltPanCameraFixture implements ITestFixture {
|
||||
tilt = null;
|
||||
pan.free();
|
||||
pan = null;
|
||||
if(gyro !=null){//in case not freed during gyro tests
|
||||
gyro.free();
|
||||
gyro = null;
|
||||
}
|
||||
if(gyroParam != null){//in case gyro tests failed before getting to this point
|
||||
gyroParam.free();
|
||||
gyroParam = null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user