From e817920eeab67a1c94c797fc91096919e3d80f30 Mon Sep 17 00:00:00 2001 From: Daniel Baston Date: Mon, 30 Nov 2015 01:16:03 +0000 Subject: [PATCH] Fix minimum bounding circle test for 32-bit build git-svn-id: http://svn.osgeo.org/postgis/trunk@14450 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/cunit/cu_minimum_bounding_circle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/liblwgeom/cunit/cu_minimum_bounding_circle.c b/liblwgeom/cunit/cu_minimum_bounding_circle.c index 05771fe3b..277fd7bb8 100644 --- a/liblwgeom/cunit/cu_minimum_bounding_circle.c +++ b/liblwgeom/cunit/cu_minimum_bounding_circle.c @@ -27,7 +27,12 @@ static void mbc_test(LWGEOM* g) p.x = p4.x; p.y = p4.y; - CU_ASSERT_TRUE(distance2d_pt_pt(result->center, &p) <= result->radius); + /* We need to store the distance in a variable before the assert so that + * it is rounded from its 80-bit representation (on x86) down to 64 bits. + * */ + double d = distance2d_pt_pt(result->center, &p); + + CU_ASSERT_TRUE(d <= result->radius); } lwboundingcircle_destroy(result); -- 2.40.0