PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ test_gserialized1_peek_gbox_p_no_box_when_empty()

static void test_gserialized1_peek_gbox_p_no_box_when_empty ( void  )
static

Definition at line 1090 of file cu_gserialized1.c.

1091 {
1092  uint32_t i;
1093 
1094  char *ewkt[] =
1095  {
1096  "POINT EMPTY",
1097  "LINESTRING EMPTY",
1098  "MULTIPOINT EMPTY",
1099  "MULTIPOINT (EMPTY)",
1100  "MULTILINESTRING EMPTY",
1101  "MULTILINESTRING (EMPTY)"
1102  };
1103 
1104  for ( i = 0; i < (sizeof ewkt/sizeof(char*)); i++ )
1105  {
1106  LWGEOM* geom = lwgeom_from_wkt(ewkt[i], LW_PARSER_CHECK_NONE);
1107  GBOX box;
1108  gbox_init(&box);
1109 
1110  GSERIALIZED* gser = gserialized1_from_lwgeom(geom, NULL);
1111 
1112  CU_ASSERT_FALSE(gserialized1_has_bbox(gser));
1113 
1114  CU_ASSERT_EQUAL(LW_FAILURE, gserialized1_peek_gbox_p(gser, &box));
1115 
1116  lwgeom_free(geom);
1117  lwfree(gser);
1118  }
1119 }
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
Definition: gbox.c:40
int gserialized1_peek_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Definition: gserialized1.c:299
int gserialized1_has_bbox(const GSERIALIZED *gser)
Check if a GSERIALIZED has a bounding box without deserializing first.
Definition: gserialized1.c:91
GSERIALIZED * gserialized1_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
#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(), gserialized1_from_lwgeom(), gserialized1_has_bbox(), gserialized1_peek_gbox_p(), LW_FAILURE, LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), 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: