]> granicus.if.org Git - postgis/commitdiff
Fix minimum bounding circle test for 32-bit build
authorDaniel Baston <dbaston@gmail.com>
Mon, 30 Nov 2015 01:16:03 +0000 (01:16 +0000)
committerDaniel Baston <dbaston@gmail.com>
Mon, 30 Nov 2015 01:16:03 +0000 (01:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14450 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_minimum_bounding_circle.c

index 05771fe3bb6435b251e4f49965a973adf721c7e7..277fd7bb8de01fbae63a3335b03513a481728c3e 100644 (file)
@@ -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);