Use OpenLayers.Util.DEFAULT_PRECISION for geometry comparisons
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
* replaced with string representations of the above arguments.
|
* replaced with string representations of the above arguments.
|
||||||
*/
|
*/
|
||||||
function assertFloatEqual(got, expected, msg) {
|
function assertFloatEqual(got, expected, msg) {
|
||||||
|
var OpenLayers = Test.AnotherWay._g_test_iframe.OpenLayers;
|
||||||
if(got === undefined) {
|
if(got === undefined) {
|
||||||
got = "undefined";
|
got = "undefined";
|
||||||
} else if (got === null) {
|
} else if (got === null) {
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
} else if (expected === null) {
|
} else if (expected === null) {
|
||||||
expected = "null";
|
expected = "null";
|
||||||
}
|
}
|
||||||
if(Math.abs(got - expected) > 0.000000001) {
|
if(Math.abs(got - expected) > Math.pow(10, -OpenLayers.Util.DEFAULT_PRECISION)) {
|
||||||
throw msg + ": got '" + got + "' but expected '" + expected + "'";
|
throw msg + ": got '" + got + "' but expected '" + expected + "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user