Unignored a couple of GPS tests
- The issue was with accuracy. Average of two coords is fine fo two point fairly close together (<1km), but not for very very large distances. - We only ever use it for small ranges so changed tests to reflect that #story[881]
This commit is contained in:
@@ -4,6 +4,7 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.testng.AssertJUnit.assertEquals;
|
||||
|
||||
/**
|
||||
* Created by esa46 on 29/03/17.
|
||||
@@ -29,13 +30,12 @@ public class CompoundMarkTest {
|
||||
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void averageLatOfTwoMarksIsAccurate() {
|
||||
|
||||
GPSCoordinate testCoord = new GPSCoordinate(10, 0);
|
||||
GPSCoordinate testCoord = new GPSCoordinate(0.001, 0);
|
||||
Marker testMark = new Marker(ORIGIN_COORD, testCoord);
|
||||
assertTrue(testMark.getAverageGPSCoordinate().equals(new GPSCoordinate(5, 0)));
|
||||
assertEquals(testMark.getAverageGPSCoordinate(), new GPSCoordinate(0.0005, 0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -50,10 +50,11 @@ public class CompoundMarkTest {
|
||||
@Test
|
||||
public void averageLatAndLongOfTwoMarksIsAccurate() {
|
||||
|
||||
GPSCoordinate testCoord1 = new GPSCoordinate(10, 30);
|
||||
GPSCoordinate testCoord2 = new GPSCoordinate(30, 60);
|
||||
GPSCoordinate testCoord1 = new GPSCoordinate(0.0, 30);
|
||||
GPSCoordinate testCoord2 = new GPSCoordinate(0.001, 60);
|
||||
Marker testMark = new Marker(testCoord1, testCoord2);
|
||||
assertTrue(testMark.getAverageGPSCoordinate().equals(new GPSCoordinate(020.644102, 44.014817)));
|
||||
assertEquals(testMark.getAverageGPSCoordinate().getLatitude(), 0.00051776, 1e-8);
|
||||
assertEquals(testMark.getAverageGPSCoordinate().getLongitude(), 45.000000, 1e-8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user