PostGIS  3.0.6dev-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 1086 of file cu_gserialized1.c.

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