forked from upstream-mirrors/OpenTracks
Cleanup: use Position and cleanup TrackPoint.
This commit is contained in:
@@ -7,19 +7,34 @@ import org.junit.Test;
|
||||
import java.time.Instant;
|
||||
|
||||
import de.dennisguse.opentracks.data.models.Distance;
|
||||
import de.dennisguse.opentracks.data.models.Position;
|
||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||
|
||||
public class TrackPointTest {
|
||||
|
||||
@Test
|
||||
public void distanceToPrevious() {
|
||||
TrackPoint tp1 = new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.ofEpochMilli(0))
|
||||
.setLatitude(0)
|
||||
.setLongitude(0.0001);
|
||||
TrackPoint tp1 = new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||
new Position(
|
||||
Instant.ofEpochMilli(0),
|
||||
0d,
|
||||
0.0001,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null));
|
||||
|
||||
TrackPoint tp2 = new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.ofEpochMilli(1))
|
||||
.setLatitude(0)
|
||||
.setLongitude(0.0002);
|
||||
TrackPoint tp2 = new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||
new Position(
|
||||
Instant.ofEpochMilli(1),
|
||||
0d,
|
||||
0.0002,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null));
|
||||
|
||||
// without sensor distance
|
||||
assertEquals(11.13, tp2.distanceToPrevious(tp1).toM(), 0.01);
|
||||
|
||||
Reference in New Issue
Block a user