fixed test case so it won't consider null fixes for cache additions

This commit is contained in:
Axel Uhl committed 2011-12-27 16:13:39 +01:00
1 parent 2a9687ac14
commit 820aceccc1
2 files changed
+5 -2

No files matched your search

@@ -105,7 +105,9 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
@Override
protected void cache(TimePoint timePoint, Wind fix) {
super.cache(timePoint, fix);
cachedFixes.put(timePoint, fix);
if (fix != null) {
cachedFixes.put(timePoint, fix);
}
}
};
Wind estimatedWindDirection = track.getEstimatedWind(/* position */ null, now);
@@ -232,7 +232,8 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
@Override
public void gpsFixReceived(GPSFix fix, Competitor competitor) {
if (getStart() == null || getStart().compareTo(fix.getTimePoint())>0) {
TimePoint start = getStart();
if (start == null || start.compareTo(fix.getTimePoint())>0) {
// infer race start time from fix; earliest fix received defines start if earlier than assumed start so far
setStartTimeReceived(fix.getTimePoint());
}