Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 19184)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 19185)
@@ -15,4 +15,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
@@ -28,4 +29,5 @@
 import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -152,4 +154,7 @@
         }
 
+        double fact = 12;
+        if(Utils.getSystemProperty("os.name").toLowerCase(Locale.ENGLISH).startsWith("mac os x"))
+            fact = 1700;
         for (TestData data : allData) {
             Projection proj = Projections.getProjectionByCode(data.code);
@@ -160,16 +165,24 @@
             EastNorth en = proj.latlon2eastNorth(data.ll);
             LatLon ll2 = proj.eastNorth2latlon(data.en);
-            if (!equalsJava9(en, data.en)) {
+            if (!equalsJava9(en, data.en, fact)) {
                 String error = String.format("%s (%s): Projecting latlon(%s,%s):%n" +
                         "        expected: eastnorth(%s,%s),%n" +
-                        "        but got:  eastnorth(%s,%s)!%n",
-                        proj, data.code, data.ll.lat(), data.ll.lon(), data.en.east(), data.en.north(), en.east(), en.north());
+                        "        but got:  eastnorth(%s,%s)!%n" +
+                        "        test:     [%s,%s] factor [%s,%s] threshold [%s,%s]%n",
+                        proj, data.code, data.ll.lat(), data.ll.lon(), data.en.east(), data.en.north(), en.east(), en.north(),
+                        Math.abs(en.east()-data.en.east()), Math.abs(en.north()-data.en.north()),
+                        Math.abs(en.east()-data.en.east())/Math.ulp(en.east()), Math.abs(en.north()-data.en.north())/Math.ulp(en.north()),
+                        Math.ulp(en.east()), Math.ulp(en.north()));
                 fail.append(error);
             }
-            if (!equalsJava9(ll2, data.ll2)) {
+            if (!equalsJava9(ll2, data.ll2, fact)) {
                 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" +
                         "        expected: latlon(%s,%s),%n" +
-                        "        but got:  latlon(%s,%s)!%n",
-                        proj, data.code, data.en.east(), data.en.north(), data.ll2.lat(), data.ll2.lon(), ll2.lat(), ll2.lon());
+                        "        but got:  latlon(%s,%s)!%n" +
+                        "        test:     [%s,%s] factor [%s,%s], threshold [%s,%s]%n",
+                        proj, data.code, data.en.east(), data.en.north(), data.ll2.lat(), data.ll2.lon(), ll2.lat(), ll2.lon(),
+                        Math.abs(ll2.lat()-data.ll2.lat()), Math.abs(ll2.lon()-data.ll2.lon()),
+                        Math.abs(ll2.lat()-data.ll2.lat())/Math.ulp(ll2.lat()), Math.abs(ll2.lon()-data.ll2.lon())/Math.ulp(ll2.lon()),
+                        Math.ulp(ll2.lat()), Math.ulp(ll2.lon()));
                 fail.append(error);
             }
@@ -182,5 +195,5 @@
     }
 
-    private static boolean equalsDoubleMaxUlp(double d1, double d2) {
+    private static boolean equalsDoubleMaxUlp(double d1, double d2, double fact) {
         // Due to error accumulation in projection computation, the difference can reach hundreds of ULPs
         // The worst error is 1168 ULP (followed by 816 ULP then 512 ULP) with:
@@ -188,16 +201,15 @@
         // expected: eastnorth(-1004398.8994415681,24167.8944844745),
         // but got:  eastnorth(-1004398.8994415683,24167.894484478747)!
-        // MacOS has higher errors, otherwise 1200 would be enough
-        return Math.abs(d1 - d2) <= 1700 * Math.ulp(d1);
-    }
-
-    private static boolean equalsJava9(EastNorth en1, EastNorth en2) {
-        return equalsDoubleMaxUlp(en1.east(), en2.east()) &&
-               equalsDoubleMaxUlp(en1.north(), en2.north());
-    }
-
-    private static boolean equalsJava9(LatLon ll1, LatLon ll2) {
-        return equalsDoubleMaxUlp(ll1.lat(), ll2.lat()) &&
-               equalsDoubleMaxUlp(ll1.lon(), ll2.lon());
+        return Math.abs(d1 - d2) <= fact * Math.ulp(d1);
+    }
+
+    private static boolean equalsJava9(EastNorth en1, EastNorth en2, double fact) {
+        return equalsDoubleMaxUlp(en1.east(), en2.east(), fact) &&
+               equalsDoubleMaxUlp(en1.north(), en2.north(), fact);
+    }
+
+    private static boolean equalsJava9(LatLon ll1, LatLon ll2, double fact) {
+        return equalsDoubleMaxUlp(ll1.lat(), ll2.lat(), fact) &&
+               equalsDoubleMaxUlp(ll1.lon(), ll2.lon(), fact);
     }
 }
