PostGIS  2.2.7dev-r@@SVN_REVISION@@
static void test_lwgeom_free ( void  )
static

Definition at line 488 of file cu_libgeom.c.

References COLLECTIONTYPE, LINETYPE, LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), POINTTYPE, POLYGONTYPE, and LWGEOM::type.

Referenced by libgeom_suite_setup().

489 {
490  LWGEOM *geom;
491 
492  /* Empty geometries don't seem to free properly (#370) */
493  geom = lwgeom_from_wkt("GEOMETRYCOLLECTION EMPTY", LW_PARSER_CHECK_NONE);
494  CU_ASSERT_EQUAL(geom->type, COLLECTIONTYPE);
495  lwgeom_free(geom);
496 
497  /* Empty geometries don't seem to free properly (#370) */
498  geom = lwgeom_from_wkt("POLYGON EMPTY", LW_PARSER_CHECK_NONE);
499  CU_ASSERT_EQUAL(geom->type, POLYGONTYPE);
500  lwgeom_free(geom);
501 
502  /* Empty geometries don't seem to free properly (#370) */
503  geom = lwgeom_from_wkt("LINESTRING EMPTY", LW_PARSER_CHECK_NONE);
504  CU_ASSERT_EQUAL(geom->type, LINETYPE);
505  lwgeom_free(geom);
506 
507  /* Empty geometries don't seem to free properly (#370) */
508  geom = lwgeom_from_wkt("POINT EMPTY", LW_PARSER_CHECK_NONE);
509  CU_ASSERT_EQUAL(geom->type, POINTTYPE);
510  lwgeom_free(geom);
511 
512 }
#define LINETYPE
Definition: liblwgeom.h:71
#define POLYGONTYPE
Definition: liblwgeom.h:72
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:890
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1869
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: