From b8c8d87d5fec8a681ea8e73026551f242dbf0349 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Thu, 20 Feb 2014 16:37:35 -0800 Subject: [PATCH] Relax tests and remove a dead piece of code Apparently the implementation of sin/cos changed in the recent Chrome as now the results are off by 1e-6 (compared to a different C++ implementation we generated the tests previously). It is not worth tracking down the 1e-6 error and change implementation for it. --- packages/geojson-utils/geojson-utils.tests.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/geojson-utils/geojson-utils.tests.js b/packages/geojson-utils/geojson-utils.tests.js index 73cc5d1554..ea7ab39462 100644 --- a/packages/geojson-utils/geojson-utils.tests.js +++ b/packages/geojson-utils/geojson-utils.tests.js @@ -54,10 +54,6 @@ Tinytest.add("geojson-utils - point distance", function (test) { }); Tinytest.add("geojson-utils - points distance generated tests", function (test) { - var floatEqual = function (a, b) { - test.isTrue(Math.abs(a - b) < 0.000001); - }; - // Pairs of points we will be looking a distance between var tests = [[[-19.416501816827804,-13.442164216190577], [8.694866622798145,-8.511979941977188]], [[151.2841189110186,-56.14564002258703], [167.77983197313733,0.05544793023727834]], @@ -91,8 +87,8 @@ Tinytest.add("geojson-utils - points distance generated tests", function (test) _.each(tests, function (pair, testN) { var distance = GeoJSON.pointDistance.apply(this, _.map(pair, toGeoJSONPoint)); - test.isTrue(Math.abs(distance - answers[testN]) < 0.00000001, - "Wrong distance between points " + JSON.stringify(pair) + ": " + distance); + test.isTrue(Math.abs(distance - answers[testN]) < 0.000001, + "Wrong distance between points " + JSON.stringify(pair) + ": " + distance + ", " + Math.abs(distance - answers[testN]) + " differenc"); }); function toGeoJSONPoint (coordinates) {