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

Definition at line 480 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().

481 {
482  LWGEOM *geom;
483 
484  /* Empty geometries don't seem to free properly (#370) */
485  geom = lwgeom_from_wkt("GEOMETRYCOLLECTION EMPTY", LW_PARSER_CHECK_NONE);
486  CU_ASSERT_EQUAL(geom->type, COLLECTIONTYPE);
487  lwgeom_free(geom);
488 
489  /* Empty geometries don't seem to free properly (#370) */
490  geom = lwgeom_from_wkt("POLYGON EMPTY", LW_PARSER_CHECK_NONE);
491  CU_ASSERT_EQUAL(geom->type, POLYGONTYPE);
492  lwgeom_free(geom);
493 
494  /* Empty geometries don't seem to free properly (#370) */
495  geom = lwgeom_from_wkt("LINESTRING EMPTY", LW_PARSER_CHECK_NONE);
496  CU_ASSERT_EQUAL(geom->type, LINETYPE);
497  lwgeom_free(geom);
498 
499  /* Empty geometries don't seem to free properly (#370) */
500  geom = lwgeom_from_wkt("POINT EMPTY", LW_PARSER_CHECK_NONE);
501  CU_ASSERT_EQUAL(geom->type, POINTTYPE);
502  lwgeom_free(geom);
503 
504 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: