Changeset 6334 in josm for trunk/test/unit/org/openstreetmap/josm/data/projection
- Timestamp:
- 2013-10-27T04:06:10+01:00 (11 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/projection
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java
r6286 r6334 6 6 import org.junit.Assert; 7 7 import org.junit.Test; 8 9 8 import org.openstreetmap.josm.data.coor.LatLon; 10 9 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r5554 r6334 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.projection; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.io.BufferedReader; … … 10 8 import java.util.Collection; 11 9 import java.util.HashMap; 12 import java.util.LinkedHashMap;13 import java.util.List;14 10 import java.util.Map; 15 11 import java.util.Map.Entry; … … 68 64 { 69 65 EastNorth en = p.latlon2eastNorth(new LatLon(lat, lon)); 70 String error = String.format("%s (%s): Projecting latlon(%s,%s): \n" +71 " expected: eastnorth(%s,%s), \n" +72 " but got: eastnorth(%s,%s)! \n",66 String error = String.format("%s (%s): Projecting latlon(%s,%s):%n" + 67 " expected: eastnorth(%s,%s),%n" + 68 " but got: eastnorth(%s,%s)!%n", 73 69 p.toString(), code, lat, lon, east, north, en.east(), en.north()); 74 70 double EPSILON = 1e-3; // 1 mm accuracy … … 79 75 { 80 76 LatLon ll = p.eastNorth2latlon(new EastNorth(east, north)); 81 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s): \n" +82 " expected: latlon(%s,%s), \n" +83 " but got: latlon(%s,%s)! \n",77 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" + 78 " expected: latlon(%s,%s),%n" + 79 " but got: latlon(%s,%s)!%n", 84 80 p.toString(), code, east, north, lat, lon, ll.lat(), ll.lon()); 85 81 double EPSILON = Math.toDegrees(1e-3 / 6378137); // 1 mm accuracy (or better) -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r5554 r6334 108 108 EastNorth en = proj.latlon2eastNorth(new LatLon(lat, lon)); 109 109 LatLon ll2 = proj.eastNorth2latlon(en); 110 out.write(String.format("%s \n ll %s %s\n en %s %s\n ll2 %s %s\n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon()));110 out.write(String.format("%s%n ll %s %s%n en %s %s%n ll2 %s %s%n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon())); 111 111 } 112 112 out.close(); … … 178 178 EastNorth en = proj.latlon2eastNorth(data.ll); 179 179 if (!en.equals(data.en)) { 180 String error = String.format("%s (%s): Projecting latlon(%s,%s): \n" +181 " expected: eastnorth(%s,%s), \n" +182 " but got: eastnorth(%s,%s)! \n",180 String error = String.format("%s (%s): Projecting latlon(%s,%s):%n" + 181 " expected: eastnorth(%s,%s),%n" + 182 " but got: eastnorth(%s,%s)!%n", 183 183 proj.toString(), data.code, data.ll.lat(), data.ll.lon(), data.en.east(), data.en.north(), en.east(), en.north()); 184 184 fail.append(error); … … 186 186 LatLon ll2 = proj.eastNorth2latlon(data.en); 187 187 if (!ll2.equals(data.ll2)) { 188 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s): \n" +189 " expected: latlon(%s,%s), \n" +190 " but got: latlon(%s,%s)! \n",188 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" + 189 " expected: latlon(%s,%s),%n" + 190 " but got: latlon(%s,%s)!%n", 191 191 proj.toString(), data.code, data.en.east(), data.en.north(), data.ll2.lat(), data.ll2.lon(), ll2.lat(), ll2.lon()); 192 192 fail.append(error); -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
r5556 r6334 65 65 Bounds b = p.getWorldBoundsLatLon(); 66 66 67 text += String.format("*** %s %s \n", p.toString(), p.toCode());67 text += String.format("*** %s %s%n", p.toString(), p.toCode()); 68 68 for (int num=0; num < 1000; ++num) { 69 69 … … 86 86 error = true; 87 87 } 88 text += String.format("%s errorLat: %s errorLon: %s \n", mark, maxErrLat, maxErrLon);88 text += String.format("%s errorLat: %s errorLon: %s%n", mark, maxErrLat, maxErrLon); 89 89 } 90 90 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r6264 r6334 52 52 EastNorth en2 = swiss.latlon2eastNorth(pd.ll); 53 53 if (Math.abs(pd.en.east() - en2.east()) > EPSILON || Math.abs(pd.en.north() - en2.north()) > EPSILON) { 54 errs.append(String.format("%s should be: %s but is: %s \n", pd.name, pd.en, en2));54 errs.append(String.format("%s should be: %s but is: %s%n", pd.name, pd.en, en2)); 55 55 } 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.