PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_serialized_srid()

static void test_serialized_srid ( void  )
static

Definition at line 127 of file cu_libgeom.c.

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

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

Referenced by libgeom_suite_setup().

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