PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_on_gser_lwgeom_count_vertices()

static void test_on_gser_lwgeom_count_vertices ( void  )
static

Definition at line 406 of file cu_gserialized1.c.

407 {
408  LWGEOM *lwgeom;
409  GSERIALIZED *g_ser1;
410  size_t ret_size;
411 
412  lwgeom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1,1 1,2 2,4 5)", LW_PARSER_CHECK_NONE);
413  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
414  g_ser1 = gserialized1_from_lwgeom(lwgeom, &ret_size);
415  lwgeom_free(lwgeom);
416 
417  lwgeom = lwgeom_from_gserialized(g_ser1);
418  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
419  lwgeom_free(lwgeom);
420 
421  lwgeom = lwgeom_from_gserialized(g_ser1);
422 
423  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
424  lwgeom_free(lwgeom);
425 
426  lwfree(g_ser1);
427 
428 }
GSERIALIZED * gserialized1_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2060
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1229
void lwfree(void *mem)
Definition: lwutil.c:242
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:905

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

Referenced by gserialized1_suite_setup().

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