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

Definition at line 20 of file cu_libgeom.c.

References SRID_UNKNOWN, TYPMOD_GET_M, TYPMOD_GET_SRID, TYPMOD_GET_TYPE, TYPMOD_GET_Z, TYPMOD_SET_SRID, TYPMOD_SET_TYPE, and TYPMOD_SET_Z.

Referenced by libgeom_suite_setup().

21 {
22  int32_t typmod = 0;
23  int srid = 4326;
24  int type = 6;
25  int z = 1;
26  int rv;
27 
28  TYPMOD_SET_SRID(typmod,srid);
29  rv = TYPMOD_GET_SRID(typmod);
30  CU_ASSERT_EQUAL(rv, srid);
31 
32  srid = -5005;
33  TYPMOD_SET_SRID(typmod,srid);
34  rv = TYPMOD_GET_SRID(typmod);
35  CU_ASSERT_EQUAL(rv, srid);
36 
37  srid = 999999;
38  TYPMOD_SET_SRID(typmod,srid);
39  rv = TYPMOD_GET_SRID(typmod);
40  CU_ASSERT_EQUAL(rv, srid);
41 
42  srid = -999999;
43  TYPMOD_SET_SRID(typmod,srid);
44  rv = TYPMOD_GET_SRID(typmod);
45  CU_ASSERT_EQUAL(rv, srid);
46 
47  srid = SRID_UNKNOWN;
48  TYPMOD_SET_SRID(typmod,srid);
49  rv = TYPMOD_GET_SRID(typmod);
50  CU_ASSERT_EQUAL(rv, srid);
51 
52  srid = 0;
53  TYPMOD_SET_SRID(typmod,srid);
54  rv = TYPMOD_GET_SRID(typmod);
55  CU_ASSERT_EQUAL(rv, srid);
56 
57  srid = 1;
58  TYPMOD_SET_SRID(typmod,srid);
59  rv = TYPMOD_GET_SRID(typmod);
60  CU_ASSERT_EQUAL(rv, srid);
61 
62  TYPMOD_SET_TYPE(typmod,type);
63  rv = TYPMOD_GET_TYPE(typmod);
64  CU_ASSERT_EQUAL(rv,type);
65 
66  TYPMOD_SET_Z(typmod);
67  rv = TYPMOD_GET_Z(typmod);
68  CU_ASSERT_EQUAL(rv,z);
69 
70  rv = TYPMOD_GET_M(typmod);
71  CU_ASSERT_EQUAL(rv,0);
72 
73 }
#define TYPMOD_GET_TYPE(typmod)
Definition: liblwgeom.h:151
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:155
#define TYPMOD_SET_Z(typmod)
Definition: liblwgeom.h:154
#define TYPMOD_GET_SRID(typmod)
Macros for manipulating the 'typemod' int.
Definition: liblwgeom.h:149
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:172
#define TYPMOD_SET_TYPE(typmod, type)
Definition: liblwgeom.h:152
#define TYPMOD_SET_SRID(typmod, srid)
Definition: liblwgeom.h:150
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:153

Here is the caller graph for this function: