[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-205-g12bb499
git at osgeo.org
git at osgeo.org
Thu Jun 10 11:58:10 PDT 2021
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 12bb49953908c100683ca15bf2c2964d3b865a11 (commit)
from ed2e882e174ccfad4514dd4743e72711d58dc59e (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 12bb49953908c100683ca15bf2c2964d3b865a11
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Jun 10 11:57:48 2021 -0700
Normalize multipoint repeated test to avoid issues with cross-platform differences in qsort behaviour
diff --git a/liblwgeom/cunit/cu_algorithm.c b/liblwgeom/cunit/cu_algorithm.c
index 9fa7549..dbdbf76 100644
--- a/liblwgeom/cunit/cu_algorithm.c
+++ b/liblwgeom/cunit/cu_algorithm.c
@@ -1162,8 +1162,9 @@ test_geohash_bbox(void)
static void test_lwgeom_remove_repeated_points(void)
{
- LWGEOM *g;
+ LWGEOM *g, *gn;
char *ewkt;
+ char *ewkt_exp;
int modified = LW_FALSE;
g = lwgeom_from_wkt("MULTIPOINT(0 0, 10 0, 10 10, 10 10, 0 10, 0 10, 0 10, 0 0, 0 0, 0 0, 5 5, 0 0, 5 5)", LW_PARSER_CHECK_NONE);
@@ -1182,14 +1183,23 @@ static void test_lwgeom_remove_repeated_points(void)
lwgeom_free(g);
lwfree(ewkt);
+ /* remove points */
g = lwgeom_from_wkt("MULTIPOINT(0 0,10 0,10 10,10 10,0 10,0 10,0 10,0 0,0 0,0 0,5 5,5 5,5 8,8 8,8 8,8 8,8 5,8 5,5 5,5 5,5 5,5 5,5 5,50 50,50 50,50 50,50 60,50 60,50 60,60 60,60 50,60 50,50 50,55 55,55 58,58 58,58 55,58 55,55 55)", LW_PARSER_CHECK_NONE);
modified = lwgeom_remove_repeated_points_in_place(g, 1);
ASSERT_INT_EQUAL(modified, LW_TRUE);
- ewkt = lwgeom_to_ewkt(g);
- ASSERT_STRING_EQUAL(
- ewkt, "MULTIPOINT(0 0,0 10,5 5,5 8,8 5,8 8,10 0,10 10,50 50,50 60,55 55,55 58,58 55,58 58,60 50,60 60)");
+ gn = lwgeom_normalize(g);
+ ewkt = lwgeom_to_ewkt(gn);
+ lwgeom_free(g);
+ lwgeom_free(gn);
+ /* build expected and normalize */
+ g = lwgeom_from_wkt("MULTIPOINT(0 0,0 10,5 5,5 8,8 5,8 8,10 0,10 10,50 50,50 60,55 55,55 58,58 55,58 58,60 50,60 60)", LW_PARSER_CHECK_NONE);
+ gn = lwgeom_normalize(g);
+ ewkt_exp = lwgeom_to_ewkt(gn);
+ ASSERT_STRING_EQUAL(ewkt, ewkt_exp);
lwgeom_free(g);
+ lwgeom_free(gn);
lwfree(ewkt);
+ lwfree(ewkt_exp);
g = lwgeom_from_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", LW_PARSER_CHECK_NONE);
modified = lwgeom_remove_repeated_points_in_place(g, 10000);
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/cunit/cu_algorithm.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list