PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_gserialized2_srid()

static void test_gserialized2_srid ( void  )
static

Definition at line 104 of file cu_gserialized2.c.

105 {
106  GSERIALIZED s;
107  int32_t srid, rv;
108 
109  srid = 4326;
110  gserialized2_set_srid(&s, srid);
111  rv = gserialized2_get_srid(&s);
112  CU_ASSERT_EQUAL(rv, srid);
113 
114  srid = -3005;
115  gserialized2_set_srid(&s, srid);
116  rv = gserialized2_get_srid(&s);
117  //printf("srid=%d rv=%d\n",srid,rv);
118  CU_ASSERT_EQUAL(rv, SRID_UNKNOWN);
119 
120  srid = SRID_UNKNOWN;
121  gserialized2_set_srid(&s, srid);
122  rv = gserialized2_get_srid(&s);
123  CU_ASSERT_EQUAL(rv, srid);
124 
125  srid = SRID_UNKNOWN;
126  gserialized2_set_srid(&s, srid);
127  rv = gserialized2_get_srid(&s);
128  CU_ASSERT_EQUAL(rv, srid);
129 
130  srid = 100000;
131  gserialized2_set_srid(&s, srid);
132  rv = gserialized2_get_srid(&s);
133  CU_ASSERT_EQUAL(rv, srid);
134 }
char * s
Definition: cu_in_wkt.c:23
int32_t gserialized2_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: gserialized2.c:190
void gserialized2_set_srid(GSERIALIZED *g, int32_t srid)
Write the SRID into the serialized form (it is packed into three bytes so this is a handy function).
Definition: gserialized2.c:207
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:229

References gserialized2_get_srid(), gserialized2_set_srid(), s, and SRID_UNKNOWN.

Referenced by gserialized2_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: