forked from upstream-mirrors/OpenTracks
Change code style of SendToGoogleUtilsTest.
This commit is contained in:
+7
-4
@@ -99,16 +99,19 @@ public class SendToGoogleUtilsTest extends TestCase {
|
|||||||
// Use this variable as a flag to make all points in the track can be kept
|
// Use this variable as a flag to make all points in the track can be kept
|
||||||
// after run the LocationUtils#decimate(Track, double) with
|
// after run the LocationUtils#decimate(Track, double) with
|
||||||
// Ramer–Douglas–Peucker algorithm.
|
// Ramer–Douglas–Peucker algorithm.
|
||||||
int positiveOrNegative = (i % 2) == 0 ? -1 : 0;
|
double latitude = TrackStubUtils.INITIAL_LATITUDE;
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
latitude -= DIFFERENCE * (i % 10);
|
||||||
|
}
|
||||||
// Inserts 9 points which have wrong latitude, so would have 10 segments.
|
// Inserts 9 points which have wrong latitude, so would have 10 segments.
|
||||||
if (i % 10 == 0 && i > 0) {
|
if (i % 10 == 0 && i > 0) {
|
||||||
MyTracksLocation location = TrackStubUtils.createMyTracksLocation();
|
MyTracksLocation location = TrackStubUtils.createMyTracksLocation();
|
||||||
location.setLatitude(INVALID_LATITUDE);
|
location.setLatitude(INVALID_LATITUDE);
|
||||||
locationsArray.add(location);
|
locationsArray.add(location);
|
||||||
} else {
|
} else {
|
||||||
locationsArray.add(TrackStubUtils.createMyTracksLocation(TrackStubUtils.INITIAL_LATITUDE
|
locationsArray.add(TrackStubUtils.createMyTracksLocation(latitude,
|
||||||
+ DIFFERENCE * (i % 10) * positiveOrNegative, TrackStubUtils.INITIAL_LONGITUDE
|
TrackStubUtils.INITIAL_LONGITUDE + DIFFERENCE * (i % 10),
|
||||||
+ DIFFERENCE * (i % 10), TrackStubUtils.INITIAL_ALTITUDE + DIFFERENCE * (i % 10)));
|
TrackStubUtils.INITIAL_ALTITUDE + DIFFERENCE * (i % 10)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ArrayList<Track> result = SendToGoogleUtils.prepareLocations(trackStub, locationsArray);
|
ArrayList<Track> result = SendToGoogleUtils.prepareLocations(trackStub, locationsArray);
|
||||||
|
|||||||
Reference in New Issue
Block a user