made test case for bug 3364 succeed for correct implementation; extended interval of fixes whose position estimation is affected:

so far, the getEstimatedPositionTimePeriodAffectedBy method on GPSFixTrackImpl returned only the singular interval shaped by the
fix just added; this seems non-sensical given that when such a fix is inserted, the adjacent fixes before and after and everything
in between will have their position estimation affected as well.
This commit is contained in:
Axel Uhl committed 2015-11-17 21:23:56 +01:00
1 parent 78ff64b7b9
commit cf5c193ec5
2 files changed
+3 -3

No files matched your search

@@ -148,8 +148,8 @@ public class WaypointPositionAndDistanceCacheTest {
assertEquals(60+new NauticalMileDistance(20).scale(timeRangeResolution.divide(Duration.ONE_HOUR)).getNauticalMiles(), cache.getApproximateDistance(start, windwardWaypoint, now.plus(timeRangeResolution)).getNauticalMiles(), 0.01);
assertEquals(60+new NauticalMileDistance(20).scale(timeRangeResolution.times(2).divide(Duration.ONE_HOUR)).getNauticalMiles(), cache.getApproximateDistance(start, windwardWaypoint, now.plus(timeRangeResolution.times(2))).getNauticalMiles(), 0.01);
trackedRace.getOrCreateTrack(windward).add(new GPSFixImpl(new DegreePosition(1, 0).translateGreatCircle(
new DegreeBearingImpl(0), new KnotSpeedImpl(20).travel(now, now.plus(timeRangeResolution.divide(5)))),
now.plus(timeRangeResolution.divide(5)))); // cause cache invalidation with several entries in the map
new DegreeBearingImpl(0), new KnotSpeedImpl(20).travel(now, now.plus(timeRangeResolution.minus(1)))),
now.plus(timeRangeResolution.minus(1)))); // cause cache invalidation with several entries in the map
recalculations = 0;
assertEquals(60+new NauticalMileDistance(20).scale(timeRangeResolution.divide(Duration.ONE_HOUR)).getNauticalMiles(), cache.getApproximateDistance(start, windwardWaypoint, now.plus(timeRangeResolution)).getNauticalMiles(), 0.01);
assertEquals(2, recalculations); // distance calculation also requires position calculation, therefore 2, not 1