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

Definition at line 21 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().

22 {
23  int32_t typmod = 0;
24  int srid = 4326;
25  int type = 6;
26  int z = 1;
27  int rv;
28 
29  TYPMOD_SET_SRID(typmod,srid);
30  rv = TYPMOD_GET_SRID(typmod);
31  CU_ASSERT_EQUAL(rv, srid);
32 
33  srid = -5005;
34  TYPMOD_SET_SRID(typmod,srid);
35  rv = TYPMOD_GET_SRID(typmod);
36  CU_ASSERT_EQUAL(rv, srid);
37 
38  srid = SRID_UNKNOWN;
39  TYPMOD_SET_SRID(typmod,srid);
40  rv = TYPMOD_GET_SRID(typmod);
41  CU_ASSERT_EQUAL(rv, srid);
42 
43  srid = 0;
44  TYPMOD_SET_SRID(typmod,srid);
45  rv = TYPMOD_GET_SRID(typmod);
46  CU_ASSERT_EQUAL(rv, srid);
47 
48  srid = 1;
49  TYPMOD_SET_SRID(typmod,srid);
50  rv = TYPMOD_GET_SRID(typmod);
51  CU_ASSERT_EQUAL(rv, srid);
52 
53  TYPMOD_SET_TYPE(typmod,type);
54  rv = TYPMOD_GET_TYPE(typmod);
55  CU_ASSERT_EQUAL(rv,type);
56 
57  TYPMOD_SET_Z(typmod);
58  rv = TYPMOD_GET_Z(typmod);
59  CU_ASSERT_EQUAL(rv,z);
60 
61  rv = TYPMOD_GET_M(typmod);
62  CU_ASSERT_EQUAL(rv,0);
63 
64 }
#define TYPMOD_GET_TYPE(typmod)
Definition: liblwgeom.h:133
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:137
#define TYPMOD_SET_Z(typmod)
Definition: liblwgeom.h:136
#define TYPMOD_GET_SRID(typmod)
Macros for manipulating the 'typemod' int.
Definition: liblwgeom.h:131
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:154
#define TYPMOD_SET_TYPE(typmod, type)
Definition: liblwgeom.h:134
#define TYPMOD_SET_SRID(typmod, srid)
Definition: liblwgeom.h:132
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:135

Here is the caller graph for this function: