Fix unit tests for tumbling

This commit is contained in:
SiboVG 2023-03-20 13:36:06 +01:00
parent 6c02ad0b91
commit c4794e5bd9

@ -164,8 +164,10 @@ public class FlightEventsTest extends BaseTestCase {
expected.getType(), actual.getType()); expected.getType(), actual.getType());
if (1200 != expected.getTime()) { if (1200 != expected.getTime()) {
// Tumbling can have a very large time error, so implement a more course epsilon (otherwise unit tests just keep failing...)
double epsilon = actual.getType() == FlightEvent.Type.TUMBLE ? 0.05 : EPSILON;
assertEquals("Branch " + b + " FlightEvent " + i + " type " + expected.getType() + " has wrong time ", assertEquals("Branch " + b + " FlightEvent " + i + " type " + expected.getType() + " has wrong time ",
expected.getTime(), actual.getTime(), EPSILON); expected.getTime(), actual.getTime(), epsilon);
} }
// Test that the event sources are correct // Test that the event sources are correct