Changeset 4574 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2011-11-04T01:17:49+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r4573 r4574 25 25 26 26 for (double value : sampleValues) { 27 assertEquals(LatLon.roundToOsmPrecision (value), value, 0);27 assertEquals(LatLon.roundToOsmPrecisionStrict(value), value, 0); 28 28 } 29 29 30 assertEquals(LatLon.roundToOsmPrecision (0.0), 0.0, 0);31 assertEquals(LatLon.roundToOsmPrecision (-0.0), 0.0, 0);30 assertEquals(LatLon.roundToOsmPrecisionStrict(0.0), 0.0, 0); 31 assertEquals(LatLon.roundToOsmPrecisionStrict(-0.0), 0.0, 0); 32 32 33 assertEquals(LatLon.roundToOsmPrecision (0.12345678), 0.1234568, 0);34 assertEquals(LatLon.roundToOsmPrecision (0.123456789), 0.1234568, 0);33 assertEquals(LatLon.roundToOsmPrecisionStrict(0.12345678), 0.1234568, 0); 34 assertEquals(LatLon.roundToOsmPrecisionStrict(0.123456789), 0.1234568, 0); 35 35 36 assertEquals(LatLon.roundToOsmPrecision (1.12345678), 1.1234568, 0);37 assertEquals(LatLon.roundToOsmPrecision (1.123456789), 1.1234568, 0);36 assertEquals(LatLon.roundToOsmPrecisionStrict(1.12345678), 1.1234568, 0); 37 assertEquals(LatLon.roundToOsmPrecisionStrict(1.123456789), 1.1234568, 0); 38 38 39 assertEquals(LatLon.roundToOsmPrecision (10.12345678), 10.1234568, 0);40 assertEquals(LatLon.roundToOsmPrecision (10.123456789), 10.1234568, 0);39 assertEquals(LatLon.roundToOsmPrecisionStrict(10.12345678), 10.1234568, 0); 40 assertEquals(LatLon.roundToOsmPrecisionStrict(10.123456789), 10.1234568, 0); 41 41 42 assertEquals(LatLon.roundToOsmPrecision (100.12345678), 100.1234568, 0);43 assertEquals(LatLon.roundToOsmPrecision (100.123456789), 100.1234568, 0);42 assertEquals(LatLon.roundToOsmPrecisionStrict(100.12345678), 100.1234568, 0); 43 assertEquals(LatLon.roundToOsmPrecisionStrict(100.123456789), 100.1234568, 0); 44 44 45 assertEquals(LatLon.roundToOsmPrecision (100.00000001), 100.0000000, 0);46 assertEquals(LatLon.roundToOsmPrecision (100.000000001), 100.0000000, 0);47 assertEquals(LatLon.roundToOsmPrecision (100.0000000001), 100.0000000, 0);48 assertEquals(LatLon.roundToOsmPrecision (100.00000000001), 100.0000000, 0);49 assertEquals(LatLon.roundToOsmPrecision (100.000000000001), 100.0000000, 0);50 assertEquals(LatLon.roundToOsmPrecision (100.0000000000001), 100.0000000, 0);51 assertEquals(LatLon.roundToOsmPrecision (100.00000000000001), 100.0000000, 0);52 assertEquals(LatLon.roundToOsmPrecision (100.000000000000001), 100.0000000, 0);53 assertEquals(LatLon.roundToOsmPrecision (100.0000000000000001), 100.0000000, 0);54 assertEquals(LatLon.roundToOsmPrecision (100.00000000000000001), 100.0000000, 0);55 assertEquals(LatLon.roundToOsmPrecision (100.000000000000000001), 100.0000000, 0);56 assertEquals(LatLon.roundToOsmPrecision (100.0000000000000000001), 100.0000000, 0);57 assertEquals(LatLon.roundToOsmPrecision (100.00000000000000000001), 100.0000000, 0);45 assertEquals(LatLon.roundToOsmPrecisionStrict(100.00000001), 100.0000000, 0); 46 assertEquals(LatLon.roundToOsmPrecisionStrict(100.000000001), 100.0000000, 0); 47 assertEquals(LatLon.roundToOsmPrecisionStrict(100.0000000001), 100.0000000, 0); 48 assertEquals(LatLon.roundToOsmPrecisionStrict(100.00000000001), 100.0000000, 0); 49 assertEquals(LatLon.roundToOsmPrecisionStrict(100.000000000001), 100.0000000, 0); 50 assertEquals(LatLon.roundToOsmPrecisionStrict(100.0000000000001), 100.0000000, 0); 51 assertEquals(LatLon.roundToOsmPrecisionStrict(100.00000000000001), 100.0000000, 0); 52 assertEquals(LatLon.roundToOsmPrecisionStrict(100.000000000000001), 100.0000000, 0); 53 assertEquals(LatLon.roundToOsmPrecisionStrict(100.0000000000000001), 100.0000000, 0); 54 assertEquals(LatLon.roundToOsmPrecisionStrict(100.00000000000000001), 100.0000000, 0); 55 assertEquals(LatLon.roundToOsmPrecisionStrict(100.000000000000000001), 100.0000000, 0); 56 assertEquals(LatLon.roundToOsmPrecisionStrict(100.0000000000000000001), 100.0000000, 0); 57 assertEquals(LatLon.roundToOsmPrecisionStrict(100.00000000000000000001), 100.0000000, 0); 58 58 59 assertEquals(LatLon.roundToOsmPrecision (99.999999999999999999999), 100.0000000, 0);60 assertEquals(LatLon.roundToOsmPrecision (99.99999999999999999999), 100.0000000, 0);61 assertEquals(LatLon.roundToOsmPrecision (99.9999999999999999999), 100.0000000, 0);62 assertEquals(LatLon.roundToOsmPrecision (99.999999999999999999), 100.0000000, 0);63 assertEquals(LatLon.roundToOsmPrecision (99.99999999999999999), 100.0000000, 0);64 assertEquals(LatLon.roundToOsmPrecision (99.9999999999999999), 100.0000000, 0);65 assertEquals(LatLon.roundToOsmPrecision (99.999999999999999), 100.0000000, 0);66 assertEquals(LatLon.roundToOsmPrecision (99.99999999999999), 100.0000000, 0);67 assertEquals(LatLon.roundToOsmPrecision (99.9999999999999), 100.0000000, 0);68 assertEquals(LatLon.roundToOsmPrecision (99.999999999999), 100.0000000, 0);69 assertEquals(LatLon.roundToOsmPrecision (99.99999999999), 100.0000000, 0);70 assertEquals(LatLon.roundToOsmPrecision (99.9999999999), 100.0000000, 0);71 assertEquals(LatLon.roundToOsmPrecision (99.999999999), 100.0000000, 0);72 assertEquals(LatLon.roundToOsmPrecision (99.99999999), 100.0000000, 0);73 assertEquals(LatLon.roundToOsmPrecision (99.9999999), 99.9999999, 0);59 assertEquals(LatLon.roundToOsmPrecisionStrict(99.999999999999999999999), 100.0000000, 0); 60 assertEquals(LatLon.roundToOsmPrecisionStrict(99.99999999999999999999), 100.0000000, 0); 61 assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999999999999999), 100.0000000, 0); 62 assertEquals(LatLon.roundToOsmPrecisionStrict(99.999999999999999999), 100.0000000, 0); 63 assertEquals(LatLon.roundToOsmPrecisionStrict(99.99999999999999999), 100.0000000, 0); 64 assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999999999999), 100.0000000, 0); 65 assertEquals(LatLon.roundToOsmPrecisionStrict(99.999999999999999), 100.0000000, 0); 66 assertEquals(LatLon.roundToOsmPrecisionStrict(99.99999999999999), 100.0000000, 0); 67 assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999999999), 100.0000000, 0); 68 assertEquals(LatLon.roundToOsmPrecisionStrict(99.999999999999), 100.0000000, 0); 69 assertEquals(LatLon.roundToOsmPrecisionStrict(99.99999999999), 100.0000000, 0); 70 assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999999), 100.0000000, 0); 71 assertEquals(LatLon.roundToOsmPrecisionStrict(99.999999999), 100.0000000, 0); 72 assertEquals(LatLon.roundToOsmPrecisionStrict(99.99999999), 100.0000000, 0); 73 assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999), 99.9999999, 0); 74 74 } 75 75 }
Note:
See TracChangeset
for help on using the changeset viewer.