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

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

426 {
427  LWGEOM *lwgeom;
428  GSERIALIZED *g_ser1;
429  size_t ret_size;
430 
431  lwgeom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1,1 1,2 2,4 5)", LW_PARSER_CHECK_NONE);
432  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
433  g_ser1 = gserialized_from_lwgeom(lwgeom, 1, &ret_size);
434  lwgeom_free(lwgeom);
435 
436  lwgeom = lwgeom_from_gserialized(g_ser1);
437  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
438  lwgeom_free(lwgeom);
439 
440  lwgeom = lwgeom_from_gserialized(g_ser1);
441 
442  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
443  lwgeom_free(lwgeom);
444 
445  lwfree(g_ser1);
446 
447 }
void lwfree(void *mem)
Definition: lwutil.c:214
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
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
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, int is_geodetic, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
Definition: g_serialized.c:906
int lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1140

Here is the call graph for this function:

Here is the caller graph for this function: