Changeset 12746 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2017-09-05T22:05:45+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r12745 r12746 193 193 assertEquals(90d*90d, LatLon.ZERO.distanceSq(LatLon.NORTH_POLE), 0); 194 194 assertEquals(180d*180d, LatLon.SOUTH_POLE.distanceSq(LatLon.NORTH_POLE), 0); 195 }196 197 /**198 * Tests the methods {@link LatLon#latToString}, {@link LatLon#lonToString}, {@link LatLon#toStringCSV}.199 */200 @Test201 public void testFormatting() {202 LatLon c = new LatLon(47.000000, 19.000000);203 assertEquals("47.0", c.latToString(CoordinateFormat.DECIMAL_DEGREES));204 assertEquals("19.0", c.lonToString(CoordinateFormat.DECIMAL_DEGREES));205 assertEquals("47°00'00.0\"N", c.latToString(CoordinateFormat.DEGREES_MINUTES_SECONDS));206 assertEquals("19°00'00.0\"E", c.lonToString(CoordinateFormat.DEGREES_MINUTES_SECONDS));207 assertEquals("47°00.000'N", c.latToString(CoordinateFormat.NAUTICAL));208 assertEquals("19°00.000'E", c.lonToString(CoordinateFormat.NAUTICAL));209 assertEquals("5942074.0724311", c.latToString(CoordinateFormat.EAST_NORTH));210 assertEquals("2115070.3250722", c.lonToString(CoordinateFormat.EAST_NORTH));211 c = new LatLon(-47.000000, -19.000000);212 assertEquals("47°00'00.0\"S", c.latToString(CoordinateFormat.DEGREES_MINUTES_SECONDS));213 assertEquals("19°00'00.0\"W", c.lonToString(CoordinateFormat.DEGREES_MINUTES_SECONDS));214 assertEquals("47°00.000'S", c.latToString(CoordinateFormat.NAUTICAL));215 assertEquals("19°00.000'W", c.lonToString(CoordinateFormat.NAUTICAL));216 195 } 217 196 -
trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java
r12561 r12746 24 24 25 25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 26 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat; 26 27 27 28 /** … … 104 105 assertNotNull(latlon); 105 106 DecimalFormat f = new DecimalFormat("00.0"); 106 assertEquals("51°46'"+f.format(43.0)+"\"", LatLon.degreesMinutesSeconds(latlon.lat()));107 assertEquals("8°21'"+f.format(56.3)+"\"", LatLon.degreesMinutesSeconds(latlon.lon()));107 assertEquals("51°46'"+f.format(43.0)+"\"", DMSCoordinateFormat.degreesMinutesSeconds(latlon.lat())); 108 assertEquals("8°21'"+f.format(56.3)+"\"", DMSCoordinateFormat.degreesMinutesSeconds(latlon.lon())); 108 109 } 109 110
Note:
See TracChangeset
for help on using the changeset viewer.