PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ test_typmod_macros()

static void test_typmod_macros ( void  )
static

Definition at line 21 of file cu_libgeom.c.

References SRID_UNKNOWN, ovdump::type, 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 = 999999;
39  TYPMOD_SET_SRID(typmod,srid);
40  rv = TYPMOD_GET_SRID(typmod);
41  CU_ASSERT_EQUAL(rv, srid);
42 
43  srid = -999999;
44  TYPMOD_SET_SRID(typmod,srid);
45  rv = TYPMOD_GET_SRID(typmod);
46  CU_ASSERT_EQUAL(rv, srid);
47 
48  srid = SRID_UNKNOWN;
49  TYPMOD_SET_SRID(typmod,srid);
50  rv = TYPMOD_GET_SRID(typmod);
51  CU_ASSERT_EQUAL(rv, srid);
52 
53  srid = 0;
54  TYPMOD_SET_SRID(typmod,srid);
55  rv = TYPMOD_GET_SRID(typmod);
56  CU_ASSERT_EQUAL(rv, srid);
57 
58  srid = 1;
59  TYPMOD_SET_SRID(typmod,srid);
60  rv = TYPMOD_GET_SRID(typmod);
61  CU_ASSERT_EQUAL(rv, srid);
62 
63  TYPMOD_SET_TYPE(typmod,type);
64  rv = TYPMOD_GET_TYPE(typmod);
65  CU_ASSERT_EQUAL(rv,type);
66 
67  TYPMOD_SET_Z(typmod);
68  rv = TYPMOD_GET_Z(typmod);
69  CU_ASSERT_EQUAL(rv,z);
70 
71  rv = TYPMOD_GET_M(typmod);
72  CU_ASSERT_EQUAL(rv,0);
73 
74 }
#define TYPMOD_GET_TYPE(typmod)
Definition: liblwgeom.h:166
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:170
#define TYPMOD_SET_Z(typmod)
Definition: liblwgeom.h:169
#define TYPMOD_GET_SRID(typmod)
Macros for manipulating the 'typemod' int.
Definition: liblwgeom.h:164
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:187
#define TYPMOD_SET_TYPE(typmod, type)
Definition: liblwgeom.h:167
type
Definition: ovdump.py:41
#define TYPMOD_SET_SRID(typmod, srid)
Definition: liblwgeom.h:165
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:168
Here is the caller graph for this function: