PostGIS 3.0.6dev-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 352 of file cu_gserialized2.c.

353{
354 uint32_t i;
355
356 char *ewkt[] =
357 {
358 "POINT EMPTY",
359 "LINESTRING EMPTY",
360 "MULTIPOINT EMPTY",
361 "MULTIPOINT (EMPTY)",
362 "MULTILINESTRING EMPTY",
363 "MULTILINESTRING (EMPTY)"
364 };
365
366 for ( i = 0; i < (sizeof ewkt/sizeof(char*)); i++ )
367 {
369 GBOX box;
370 gbox_init(&box);
371
372 GSERIALIZED* gser = gserialized2_from_lwgeom(geom, NULL);
373
374 CU_ASSERT_FALSE(gserialized2_has_bbox(gser));
375
376 CU_ASSERT_EQUAL(LW_FAILURE, gserialized2_peek_gbox_p(gser, &box));
377
378 lwgeom_free(geom);
379 lwfree(gser);
380 }
381}
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:110
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2060
void lwfree(void *mem)
Definition lwutil.c:242
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:905

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: