[postgis-tickets] r16488 - Fix error message in ST_ChaikinSmoothing per request

nicklas.aven at jordogskog.no nicklas.aven at jordogskog.no
Fri Mar 23 07:57:29 PDT 2018


Author: nicklas
Date: 2018-03-23 07:57:29 -0700 (Fri, 23 Mar 2018)
New Revision: 16488

Modified:
   trunk/postgis/lwgeom_functions_analytic.c
   trunk/regress/chaikin_expected
Log:
Fix error message in ST_ChaikinSmoothing per request

Modified: trunk/postgis/lwgeom_functions_analytic.c
===================================================================
--- trunk/postgis/lwgeom_functions_analytic.c	2018-03-23 14:56:46 UTC (rev 16487)
+++ trunk/postgis/lwgeom_functions_analytic.c	2018-03-23 14:57:29 UTC (rev 16488)
@@ -144,10 +144,8 @@
 	if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
 		n_iterations = PG_GETARG_INT32(1);
 
-	if (n_iterations>5)
-		elog(ERROR,"Not more than 5 iterations please");
-	if (n_iterations< 1)
-		elog(ERROR,"Number of iterations must be between 1 and 5");
+	if (n_iterations< 1 || n_iterations>5)
+		elog(ERROR,"Number of iterations must be between 1 and 5 : %s", __func__);
 
 	if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) )
 	{

Modified: trunk/regress/chaikin_expected
===================================================================
--- trunk/regress/chaikin_expected	2018-03-23 14:56:46 UTC (rev 16487)
+++ trunk/regress/chaikin_expected	2018-03-23 14:57:29 UTC (rev 16488)
@@ -1,6 +1,6 @@
 1|LINESTRING(0 0,6 6,6 10,0 16)
-ERROR:  Not more than 5 iterations please
-ERROR:  Number of iterations must be between 1 and 5
+ERROR:  Number of iterations must be between 1 and 5 : LWGEOM_ChaikinSmoothing
+ERROR:  Number of iterations must be between 1 and 5 : LWGEOM_ChaikinSmoothing
 4|LINESTRING(0 0,4.5 4.5,6 7,6 9,4.5 11.5,0 16)
 5|POINT(0 0)
 6|GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(1 1,1 2.125,1 2.75,1 3.25,1 3.875,1 5),POLYGON((5 5,5 7.8125,5.3125 9.0625,5.9375 9.6875,6.875 10,8.125 10,9.0625 9.6875,9.6875 9.0625,10 8.125,10 6.875,9.6875 5.9375,9.0625 5.3125,7.8125 5,5 5),(6 6,6 6.5625,6.0625 6.8125,6.1875 6.9375,6.375 7,6.625 7,6.8125 6.9375,6.9375 6.8125,7 6.625,7 6.375,6.9375 6.1875,6.8125 6.0625,6.5625 6,6 6)))



More information about the postgis-tickets mailing list