PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_lwgeom_free()

static void test_lwgeom_free ( void  )
static

Definition at line 489 of file cu_libgeom.c.

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

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

Referenced by libgeom_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: