PostGIS  2.2.7dev-r@@SVN_REVISION@@
static void test_serialized_srid ( void  )
static

Definition at line 126 of file cu_libgeom.c.

References gserialized_get_srid(), gserialized_set_srid(), s, and SRID_UNKNOWN.

Referenced by libgeom_suite_setup().

127 {
128  GSERIALIZED s;
129  int32_t srid, rv;
130 
131  srid = 4326;
132  gserialized_set_srid(&s, srid);
133  rv = gserialized_get_srid(&s);
134  CU_ASSERT_EQUAL(rv, srid);
135 
136  srid = -3005;
137  gserialized_set_srid(&s, srid);
138  rv = gserialized_get_srid(&s);
139  //printf("srid=%d rv=%d\n",srid,rv);
140  CU_ASSERT_EQUAL(rv, SRID_UNKNOWN);
141 
142  srid = SRID_UNKNOWN;
143  gserialized_set_srid(&s, srid);
144  rv = gserialized_get_srid(&s);
145  CU_ASSERT_EQUAL(rv, srid);
146 
147  srid = SRID_UNKNOWN;
148  gserialized_set_srid(&s, srid);
149  rv = gserialized_get_srid(&s);
150  CU_ASSERT_EQUAL(rv, srid);
151 
152  srid = 100000;
153  gserialized_set_srid(&s, srid);
154  rv = gserialized_get_srid(&s);
155  CU_ASSERT_EQUAL(rv, srid);
156 }
void gserialized_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: g_serialized.c:86
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:172
char * s
Definition: cu_in_wkt.c:23
int32_t gserialized_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: g_serialized.c:69

Here is the call graph for this function:

Here is the caller graph for this function: