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)) )
{
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)))