PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ 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  {
354  LWGEOM* geom = lwgeom_from_wkt(ewkt[i], LW_PARSER_CHECK_NONE);
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
int gserialized2_peek_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Definition: gserialized2.c:360
GSERIALIZED * gserialized2_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
int gserialized2_has_bbox(const GSERIALIZED *g)
Check if a GSERIALIZED has a bounding box without deserializing first.
Definition: gserialized2.c:146
#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: