PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ test_on_gser_lwgeom_count_vertices()

static void test_on_gser_lwgeom_count_vertices ( void  )
static

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

427 {
428  LWGEOM *lwgeom;
429  GSERIALIZED *g_ser1;
430  size_t ret_size;
431 
432  lwgeom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1,1 1,2 2,4 5)", LW_PARSER_CHECK_NONE);
433  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
434  g_ser1 = gserialized_from_lwgeom(lwgeom, &ret_size);
435  lwgeom_free(lwgeom);
436 
437  lwgeom = lwgeom_from_gserialized(g_ser1);
438  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
439  lwgeom_free(lwgeom);
440 
441  lwgeom = lwgeom_from_gserialized(g_ser1);
442 
443  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
444  lwgeom_free(lwgeom);
445 
446  lwfree(g_ser1);
447 
448 }
void lwfree(void *mem)
Definition: lwutil.c:244
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2004
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1235
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
Here is the call graph for this function:
Here is the caller graph for this function: