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

Definition at line 417 of file cu_libgeom.c.

References gserialized_from_lwgeom(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_count_vertices(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_from_wkt().

Referenced by libgeom_suite_setup().

418 {
419  LWGEOM *lwgeom;
420  GSERIALIZED *g_ser1;
421  size_t ret_size;
422 
423  lwgeom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1,1 1,2 2,4 5)", LW_PARSER_CHECK_NONE);
424  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
425  g_ser1 = gserialized_from_lwgeom(lwgeom, 1, &ret_size);
426  lwgeom_free(lwgeom);
427 
428  lwgeom = lwgeom_from_gserialized(g_ser1);
429  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
430  lwgeom_free(lwgeom);
431 
432  lwgeom = lwgeom_from_gserialized(g_ser1);
433 
434  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
435  lwgeom_free(lwgeom);
436 
437  lwfree(g_ser1);
438 
439 }
void lwfree(void *mem)
Definition: lwutil.c:190
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
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
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, int is_geodetic, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
Definition: g_serialized.c:908
int lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1072

Here is the call graph for this function:

Here is the caller graph for this function: