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

Definition at line 117 of file cu_libgeom.c.

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

Referenced by libgeom_suite_setup().

118 {
119  GSERIALIZED s;
120  int32_t srid, rv;
121 
122  srid = 4326;
123  gserialized_set_srid(&s, srid);
124  rv = gserialized_get_srid(&s);
125  CU_ASSERT_EQUAL(rv, srid);
126 
127  srid = -3005;
128  gserialized_set_srid(&s, srid);
129  rv = gserialized_get_srid(&s);
130  //printf("srid=%d rv=%d\n",srid,rv);
131  CU_ASSERT_EQUAL(rv, SRID_UNKNOWN);
132 
133  srid = SRID_UNKNOWN;
134  gserialized_set_srid(&s, srid);
135  rv = gserialized_get_srid(&s);
136  CU_ASSERT_EQUAL(rv, srid);
137 
138  srid = SRID_UNKNOWN;
139  gserialized_set_srid(&s, srid);
140  rv = gserialized_get_srid(&s);
141  CU_ASSERT_EQUAL(rv, srid);
142 
143  srid = 100000;
144  gserialized_set_srid(&s, srid);
145  rv = gserialized_get_srid(&s);
146  CU_ASSERT_EQUAL(rv, srid);
147 }
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:87
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:154
char * s
Definition: cu_in_wkt.c:24
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:70

Here is the call graph for this function:

Here is the caller graph for this function: