[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0beta2-9-g8cff748a3

git at osgeo.org git at osgeo.org
Sat Jul 23 15:01:38 PDT 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  8cff748a310253c20b769f13419cb2363e5160f8 (commit)
      from  d624c45fe4941ae79f3a85e48d8eca54d676597f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8cff748a310253c20b769f13419cb2363e5160f8
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Jul 23 18:00:38 2022 -0400

    Minimum Bounding Circle regress failure on i386 Debian
    Revise test to ignore micro floating point difference
    Closes #5157 for PostGIS 3.3.0

diff --git a/NEWS b/NEWS
index 066ddb944..505abbff1 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ Requires SFCGAL 1.4.1+ for ST_AlphaShape and ST_OptimalAlphaShape.
 Changes since PostGIS 3.3.0beta2:
 * Bug fixes *
   - #5154, raster ST_Value is undercosted (Regina Obe)
+  - #5157, Revise minimum_bounding_circle Cunit test
+           to be tolerant of small 32-bit floating point differences
+           (Regina Obe)
 
 
 
diff --git a/liblwgeom/cunit/cu_minimum_bounding_circle.c b/liblwgeom/cunit/cu_minimum_bounding_circle.c
index 50e0395a0..3f49ec9a9 100644
--- a/liblwgeom/cunit/cu_minimum_bounding_circle.c
+++ b/liblwgeom/cunit/cu_minimum_bounding_circle.c
@@ -22,17 +22,26 @@ static void mbc_test(LWGEOM* g)
 
 	POINT2D p;
 	POINT4D p4;
+	char *msg1 = "mbc_test failed (got %.12f should be less than radius %.12f) \n";
 	while (lwpointiterator_next(it, &p4))
 	{
-		p.x = p4.x;
-		p.y = p4.y;
+			p.x = p4.x;
+			p.y = p4.y;
 
-		/* 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.
-		 * */
-		volatile double d = distance2d_pt_pt(result->center, &p);
-
-		CU_ASSERT_TRUE(d <= 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.
+				* */
+			volatile double d = distance2d_pt_pt(result->center, &p);
+			//char *msg1 = "mbc_test failed (got %.12f expected %.12f) \n";
+			if ( (d - result->radius) > 0.0000001  )
+			{
+							printf(msg1, d, result->radius);
+							CU_FAIL();
+			}
+			else
+			{
+							CU_PASS();
+			}
 	}
 
 	lwboundingcircle_destroy(result);

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                         |  3 +++
 liblwgeom/cunit/cu_minimum_bounding_circle.c | 25 +++++++++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list