Tried to improve reliability of a couple of unit tests.

Change-Id: I45307da855808e85c8f9b9958c7590d60636f8e9
This commit is contained in:
James Kuszmaul
2014-11-20 16:39:00 -05:00
parent 99dc3c90ed
commit 91c70daf5b
2 changed files with 15 additions and 10 deletions

View File

@@ -61,14 +61,11 @@ public class GyroTest extends AbstractComsSetup {
tpcam.getPan().setAngle(45);
Timer.delay(.1);
}
Timer.delay(0.5);
//Reset for setup
tpcam.getGyro().reset();
//Prevent drift
for(int i = 0; i < 10; i++) {
tpcam.getPan().setAngle(45);
Timer.delay(.1);
}
Timer.delay(0.5);
//Perform test
for(int i = 450; i < 1350; i++) {
@@ -88,6 +85,10 @@ public class GyroTest extends AbstractComsSetup {
@Test
public void testDeviationOverTime(){
// Make sure that the test isn't influenced by any previous motions.
Timer.delay(0.25);
tpcam.getGyro().reset();
Timer.delay(0.25);
double angle = tpcam.getGyro().getAngle();
assertEquals(errorMessage(angle, 0), 0, angle, .5);
Timer.delay(5);