Ticket #24238: more_tests_24238.patch
| File more_tests_24238.patch, 2.1 KB (added by , 11 months ago) |
|---|
-
photo_geotagging/test/unit/org/openstreetmap/josm/plugins/photo_geotagging/ExifGPSTaggerTest.java
21 21 import org.openstreetmap.josm.TestUtils; 22 22 import org.openstreetmap.josm.data.coor.LatLon; 23 23 import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry; 24 import org.openstreetmap.josm.tools.ExifReader; 24 25 25 26 class ExifGPSTaggerTest { 26 27 … … 72 73 } 73 74 74 75 @Test 75 public void testTicket24278() {76 public void testTicket24278() throws Exception{ 76 77 final File in = new File(TestUtils.getTestDataRoot(), "_DSC1234.jpg"); 77 78 final File out = new File(tempFolder, in.getName()); 78 79 final ImageEntry image = newImageEntry("test", 12d, 34d, Instant.now(), 12.34d, Math.E, Math.PI); 79 image.setExifGpsTrack( Math.PI);80 image.setGpsDiffMode( 2);80 image.setExifGpsTrack(97.99); 81 image.setGpsDiffMode(1); 81 82 image.setGps2d3dMode(3); 82 83 image.setExifGpsProcMethod("GPS"); 83 84 image.setExifHPosErr(1.2d); 84 85 image.setExifGpsDop(2.5d); 85 86 image.setExifGpsDatum("WGS84"); 86 assertDoesNotThrow(() -> ExifGPSTagger.setExifGPSTag(in, out, image, true)); 87 /* TODO read temp file and assertEquals EXIF metadata values */ 87 ExifGPSTagger.setExifGPSTag(in, out, image, true); 88 assertEquals(Math.PI, ExifReader.readDirection(out), 0.001); 89 assertEquals(97.99, ExifReader.readGpsTrackDirection(out)); 90 assertEquals(1, ExifReader.readGpsDiffMode(out)); 91 assertEquals(3, ExifReader.readGpsMeasureMode(out)); 92 assertEquals("GPS", ExifReader.readGpsProcessingMethod(out)); 93 assertEquals(1.2, ExifReader.readHpositioningError(out)); 94 assertEquals(2.5, ExifReader.readGpsDop(out)); 95 assertEquals("WGS84", ExifReader.readGpsDatum(out)); 88 96 } 89 97 }
