PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_serialized1_srid()

static void test_serialized1_srid ( void  )
static

Definition at line 121 of file cu_gserialized1.c.

122 {
123  GSERIALIZED s;
124  int32_t srid, rv;
125 
126  srid = 4326;
127  gserialized1_set_srid(&s, srid);
128  rv = gserialized1_get_srid(&s);
129  CU_ASSERT_EQUAL(rv, srid);
130 
131  srid = -3005;
132  gserialized1_set_srid(&s, srid);
133  rv = gserialized1_get_srid(&s);
134  //printf("srid=%d rv=%d\n",srid,rv);
135  CU_ASSERT_EQUAL(rv, SRID_UNKNOWN);
136 
137  srid = SRID_UNKNOWN;
138  gserialized1_set_srid(&s, srid);
139  rv = gserialized1_get_srid(&s);
140  CU_ASSERT_EQUAL(rv, srid);
141 
142  srid = SRID_UNKNOWN;
143  gserialized1_set_srid(&s, srid);
144  rv = gserialized1_get_srid(&s);
145  CU_ASSERT_EQUAL(rv, srid);
146 
147  srid = 100000;
148  gserialized1_set_srid(&s, srid);
149  rv = gserialized1_get_srid(&s);
150  CU_ASSERT_EQUAL(rv, srid);
151 }
char * s
Definition: cu_in_wkt.c:23
int32_t gserialized1_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: gserialized1.c:142
void gserialized1_set_srid(GSERIALIZED *s, int32_t srid)
Write the SRID into the serialized form (it is packed into three bytes so this is a handy function).
Definition: gserialized1.c:159
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:229

References gserialized1_get_srid(), gserialized1_set_srid(), s, and SRID_UNKNOWN.

Referenced by gserialized1_suite_setup().

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