PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_gserialized1_peek_first_point()

static void test_gserialized1_peek_first_point ( void  )
static

Definition at line 1225 of file cu_gserialized1.c.

1226 {
1227  POINT4D p = {0};
1228 
1229  CU_ASSERT(peek1_point_helper("POINT(1 2)", &p) == LW_SUCCESS);
1230  CU_ASSERT_EQUAL(p.x, 1);
1231  CU_ASSERT_EQUAL(p.y, 2);
1232 
1233  CU_ASSERT(peek1_point_helper("POINTZ(10 20 30)", &p) == LW_SUCCESS);
1234  CU_ASSERT_EQUAL(p.x, 10);
1235  CU_ASSERT_EQUAL(p.y, 20);
1236  CU_ASSERT_EQUAL(p.z, 30);
1237 
1238  CU_ASSERT(peek1_point_helper("POINTM(100 200 300)", &p) == LW_SUCCESS);
1239  CU_ASSERT_EQUAL(p.x, 100);
1240  CU_ASSERT_EQUAL(p.y, 200);
1241  CU_ASSERT_EQUAL(p.m, 300);
1242 
1243  CU_ASSERT(peek1_point_helper("POINTZM(1000 2000 3000 4000)", &p) == LW_SUCCESS);
1244  CU_ASSERT_EQUAL(p.x, 1000);
1245  CU_ASSERT_EQUAL(p.y, 2000);
1246  CU_ASSERT_EQUAL(p.z, 3000);
1247  CU_ASSERT_EQUAL(p.m, 4000);
1248 
1249  CU_ASSERT(peek1_point_helper("MULTIPOINT((0 0), (1 1))", &p) == LW_FAILURE);
1250  CU_ASSERT(peek1_point_helper("LINESTRING(0 0, 1 1)", &p) == LW_FAILURE);
1251  CU_ASSERT(peek1_point_helper("MULTILINESTRING((0 0, 1 1), (0 0, 1 1))", &p) == LW_FAILURE);
1252  CU_ASSERT(peek1_point_helper("POLYGON((0 0, 1 1, 1 0, 0 0))", &p) == LW_FAILURE);
1253 }
static int peek1_point_helper(char *geometry, POINT4D *p)
#define LW_FAILURE
Definition: liblwgeom.h:110
#define LW_SUCCESS
Definition: liblwgeom.h:111
double m
Definition: liblwgeom.h:400
double x
Definition: liblwgeom.h:400
double z
Definition: liblwgeom.h:400
double y
Definition: liblwgeom.h:400

References LW_FAILURE, LW_SUCCESS, POINT4D::m, peek1_point_helper(), POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by gserialized1_suite_setup().

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