Skip to content

Commit b172396

Browse files
committed
Use a fixed precision for the tests.
1 parent a50db7c commit b172396

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

tests/geospatial_haversine_london_edinburgh.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Check the haversine function returns the correct distance between London and Edinburgh.
33
--SKIPIF--
44
<?php if (!extension_loaded("geospatial")) print "skip"; ?>
5+
--INI--
6+
precision=14
57
--FILE--
68
<?php
79
echo haversine(51.5171, 0.1062, 55.9500, 3.2200);

tests/geospatial_haversine_polar_distance.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Check the haversine function returns the correct distance between the North and South poles, using a custom radius.
33
--SKIPIF--
44
<?php if (!extension_loaded("geospatial")) print "skip"; ?>
5+
--INI--
6+
precision=14
57
--FILE--
68
<?php
79
echo haversine(90, 0, -90, 0, 6356.7523);

tests/haversine.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
2-
haversine() function - bastic test for haversine forumla
2+
haversine() function - basic test for haversine forumla
3+
--INI--
4+
precision=15
35
--FILE--
46
<?php
57
$lat1 = 39.06546;
@@ -10,4 +12,4 @@ $lon2 = -104.80;
1012
var_dump(haversine($lat1, $lon1, $lat2, $lon2));
1113
?>
1214
--EXPECT--
13-
float(7.3785163137969)
15+
float(7.38469839293155)

0 commit comments

Comments
 (0)