[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.1-40-g3ac21e6
git at osgeo.org
git at osgeo.org
Mon Aug 10 08:44:21 PDT 2020
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, stable-3.0 has been updated
via 3ac21e695872c12feba94c1113d3a7627fb2c187 (commit)
from f808b59b85707f93ab87016081302a6938e3ff22 (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 3ac21e695872c12feba94c1113d3a7627fb2c187
Author: Regina Obe <lr at pcorp.us>
Date: Mon Aug 10 11:44:03 2020 -0400
Normalize cunit output for split and wrapx tests so pass on all versions of GEOS. References #4730 for PostGIS 3.0.2 stable-3.0
diff --git a/liblwgeom/cunit/cu_split.c b/liblwgeom/cunit/cu_split.c
index 1e9e73b..d637051 100644
--- a/liblwgeom/cunit/cu_split.c
+++ b/liblwgeom/cunit/cu_split.c
@@ -124,10 +124,13 @@ static void test_lwgeom_split(void)
geom = lwgeom_from_wkt("SRID=1;LINESTRING(0 1,10 1)", LW_PARSER_CHECK_NONE);
CU_ASSERT(geom != NULL);
blade = lwgeom_from_wkt("LINESTRING(7 0,7 3)", LW_PARSER_CHECK_NONE);
- ret = lwgeom_split(geom, blade);
+ ret = lwgeom_normalize(lwgeom_split(geom, blade));
CU_ASSERT(ret != NULL);
wkt = lwgeom_to_ewkt(ret);
- in_wkt = "SRID=1;GEOMETRYCOLLECTION(LINESTRING(0 1,7 1),LINESTRING(7 1,10 1))";
+ in_wkt = lwgeom_to_ewkt(lwgeom_normalize(
+ lwgeom_from_wkt("SRID=1;GEOMETRYCOLLECTION(LINESTRING(0 1,7 1),LINESTRING(7 1,10 1))",
+ LW_PARSER_CHECK_NONE)));
+ ;
if (strcmp(in_wkt, wkt))
fprintf(stderr, "\nExp: %s\nObt: %s\n", in_wkt, wkt);
CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
@@ -140,10 +143,12 @@ static void test_lwgeom_split(void)
geom = lwgeom_from_wkt("SRID=1;POLYGON((0 1, 10 1, 10 10, 0 10, 0 1))", LW_PARSER_CHECK_NONE);
CU_ASSERT(geom != NULL);
blade = lwgeom_from_wkt("LINESTRING(7 0,7 20)", LW_PARSER_CHECK_NONE);
- ret = lwgeom_split(geom, blade);
+ ret = lwgeom_normalize(lwgeom_split(geom, blade));
CU_ASSERT(ret != NULL);
wkt = lwgeom_to_ewkt(ret);
- in_wkt = "SRID=1;GEOMETRYCOLLECTION(POLYGON((7 1,0 1,0 10,7 10,7 1)),POLYGON((7 10,10 10,10 1,7 1,7 10)))";
+ in_wkt = lwgeom_to_ewkt(lwgeom_normalize(
+ lwgeom_from_wkt("SRID=1;GEOMETRYCOLLECTION(POLYGON((7 1,0 1,0 10,7 10,7 1)),POLYGON((7 10,10 10,10 1,7 1,7 10)))",
+ LW_PARSER_CHECK_NONE)));
if (strcmp(in_wkt, wkt))
fprintf(stderr, "\nExp: %s\nObt: %s\n", in_wkt, wkt);
CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
@@ -177,12 +182,14 @@ static void test_lwgeom_split(void)
blade = lwgeom_from_wkt(
"POLYGON((1 -2,1 1,2 1,2 -1,3 -1,3 1,11 1,11 -2,1 -2))",
LW_PARSER_CHECK_NONE);
- ret = lwgeom_split(geom, blade);
+ ret = lwgeom_normalize(lwgeom_split(geom, blade));
if ( ! ret ) printf("%s", cu_error_msg);
CU_ASSERT_FATAL(ret != NULL);
wkt = lwgeom_to_ewkt(ret);
CU_ASSERT_FATAL(wkt != NULL);
- in_wkt = "GEOMETRYCOLLECTION(LINESTRING(0 0,1 0),LINESTRING(1 0,2 0),LINESTRING(2 0,3 0),LINESTRING(3 0,10 0))";
+ in_wkt = lwgeom_to_ewkt(lwgeom_normalize(lwgeom_from_wkt(
+ "GEOMETRYCOLLECTION(LINESTRING(0 0,1 0),LINESTRING(1 0,2 0),LINESTRING(2 0,3 0),LINESTRING(3 0,10 0))",
+ LW_PARSER_CHECK_NONE)));
if (strcmp(in_wkt, wkt))
fprintf(stderr, "\nExp: %s\nObt: %s\n", in_wkt, wkt);
CU_ASSERT_STRING_EQUAL(wkt, in_wkt);
diff --git a/liblwgeom/cunit/cu_wrapx.c b/liblwgeom/cunit/cu_wrapx.c
index 9f246f3..7ee6586 100644
--- a/liblwgeom/cunit/cu_wrapx.c
+++ b/liblwgeom/cunit/cu_wrapx.c
@@ -77,10 +77,11 @@ static void test_lwgeom_wrapx(void)
"LINESTRING(0 0,10 0)",
LW_PARSER_CHECK_NONE);
CU_ASSERT_FATAL(geom != NULL);
- ret = lwgeom_wrapx(geom, 8, -10);
+ ret = lwgeom_normalize(lwgeom_wrapx(geom, 8, -10));
CU_ASSERT_FATAL(ret != NULL);
obt_wkt = lwgeom_to_ewkt(ret);
- exp_wkt = "MULTILINESTRING((0 0,8 0),(-2 0,0 0))";
+ exp_wkt = lwgeom_to_ewkt(lwgeom_normalize(lwgeom_from_wkt("MULTILINESTRING((0 0,8 0),(-2 0,0 0))",
+ LW_PARSER_CHECK_NONE)));
ASSERT_STRING_EQUAL(obt_wkt, exp_wkt);
lwfree(obt_wkt);
lwgeom_free(ret);
@@ -106,19 +107,21 @@ static void test_lwgeom_wrapx(void)
")",
LW_PARSER_CHECK_NONE);
CU_ASSERT_FATAL(geom != NULL);
- ret = lwgeom_wrapx(geom, 2, 20);
+ ret = lwgeom_normalize(lwgeom_wrapx(geom, 2, 20));
CU_ASSERT_FATAL(ret != NULL);
obt_wkt = lwgeom_to_ewkt(ret);
- exp_wkt = "GEOMETRYCOLLECTION("
- "MULTIPOLYGON("
- "((22 0,20 0,20 10,22 10,22 4,22 2,22 0)),"
- "((2 10,10 10,10 0,2 0,2 2,4 2,4 4,2 4,2 10))"
- "),"
- "MULTIPOLYGON("
- "((22 11,20 11,20 21,22 21,22 15,22 13,22 11)),"
- "((2 21,10 21,10 11,2 11,2 13,4 13,4 15,2 15,2 21))"
- ")"
- ")";
+ exp_wkt = lwgeom_to_ewkt(lwgeom_normalize(lwgeom_from_wkt(
+ "GEOMETRYCOLLECTION("
+ "MULTIPOLYGON("
+ "((22 0,20 0,20 10,22 10,22 4,22 2,22 0)),"
+ "((2 10,10 10,10 0,2 0,2 2,4 2,4 4,2 4,2 10))"
+ "),"
+ "MULTIPOLYGON("
+ "((22 11,20 11,20 21,22 21,22 15,22 13,22 11)),"
+ "((2 21,10 21,10 11,2 11,2 13,4 13,4 15,2 15,2 21))"
+ ")"
+ ")",
+ LW_PARSER_CHECK_NONE)));
ASSERT_STRING_EQUAL(obt_wkt, exp_wkt);
lwfree(obt_wkt);
lwgeom_free(ret);
@@ -144,7 +147,6 @@ static void test_lwgeom_wrapx(void)
lwfree(obt_wkt);
lwgeom_free(ret);
lwgeom_free(geom);
-
}
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/cunit/cu_split.c | 19 +++++++++++++------
liblwgeom/cunit/cu_wrapx.c | 30 ++++++++++++++++--------------
2 files changed, 29 insertions(+), 20 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list