PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_gserialized2_peek_gbox_p_no_box_when_empty()

static void test_gserialized2_peek_gbox_p_no_box_when_empty ( void  )
static

Definition at line 338 of file cu_gserialized2.c.

339{
340 uint32_t i;
341
342 char *ewkt[] =
343 {
344 "POINT EMPTY",
345 "LINESTRING EMPTY",
346 "MULTIPOINT EMPTY",
347 "MULTIPOINT (EMPTY)",
348 "MULTILINESTRING EMPTY",
349 "MULTILINESTRING (EMPTY)"
350 };
351
352 for ( i = 0; i < (sizeof ewkt/sizeof(char*)); i++ )
353 {
355 GBOX box;
356 gbox_init(&box);
357
358 GSERIALIZED* gser = gserialized2_from_lwgeom(geom, NULL);
359
360 CU_ASSERT_FALSE(gserialized2_has_bbox(gser));
361
362 CU_ASSERT_EQUAL(LW_FAILURE, gserialized2_peek_gbox_p(gser, &box));
363
364 lwgeom_free(geom);
365 lwfree(gser);
366 }
367}
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
Definition gbox.c:40
GSERIALIZED * gserialized2_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
int gserialized2_peek_gbox_p(const GSERIALIZED *g, GBOX *gbox)
int gserialized2_has_bbox(const GSERIALIZED *g)
Check if a GSERIALIZED has a bounding box without deserializing first.
#define LW_FAILURE
Definition liblwgeom.h:96
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
void lwfree(void *mem)
Definition lwutil.c:248
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940

References gbox_init(), gserialized2_from_lwgeom(), gserialized2_has_bbox(), gserialized2_peek_gbox_p(), LW_FAILURE, LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), 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: