PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_on_gser2_lwgeom_count_vertices()

static void test_on_gser2_lwgeom_count_vertices ( void  )
static

Definition at line 313 of file cu_gserialized2.c.

314 {
315  LWGEOM *lwgeom;
316  GSERIALIZED *g_ser1;
317  size_t ret_size;
318 
319  lwgeom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1,1 1,2 2,4 5)", LW_PARSER_CHECK_NONE);
320  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
321  g_ser1 = gserialized2_from_lwgeom(lwgeom, &ret_size);
322  lwgeom_free(lwgeom);
323 
324  lwgeom = lwgeom_from_gserialized2(g_ser1);
325  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
326  lwgeom_free(lwgeom);
327 
328  lwgeom = lwgeom_from_gserialized2(g_ser1);
329 
330  CU_ASSERT_EQUAL(lwgeom_count_vertices(lwgeom),7);
331  lwgeom_free(lwgeom);
332 
333  lwfree(g_ser1);
334 
335 }
LWGEOM * lwgeom_from_gserialized2(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
GSERIALIZED * gserialized2_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
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 gserialized2_from_lwgeom(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_count_vertices(), lwgeom_free(), lwgeom_from_gserialized2(), and lwgeom_from_wkt().

Referenced by gserialized2_suite_setup().

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