PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_clone()

static void test_clone ( void  )
static

Definition at line 141 of file liblwgeom/cunit/cu_misc.c.

References LW_PARSER_CHECK_ALL, lwgeom_clone(), lwgeom_free(), and lwgeom_from_wkt().

Referenced by misc_suite_setup().

142 {
143  static char *wkt = "GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0))),POINT(1 1),LINESTRING(2 3,4 5))";
145  LWGEOM *geom2;
146 
147  /* Free in "backwards" order */
148  geom2 = lwgeom_clone(geom1);
149  lwgeom_free(geom1);
150  lwgeom_free(geom2);
151 
152  /* Free in "forewards" order */
153  geom1 = lwgeom_from_wkt(wkt, LW_PARSER_CHECK_ALL);
154  geom2 = lwgeom_clone(geom1);
155  lwgeom_free(geom2);
156  lwgeom_free(geom1);
157 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:444
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2014
Here is the call graph for this function:
Here is the caller graph for this function: