PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_gserialized2_peek_first_point()

static void test_gserialized2_peek_first_point ( void  )
static

Definition at line 468 of file cu_gserialized2.c.

469 {
470  POINT4D p = {0};
471 
472  CU_ASSERT(peek2_point_helper("POINT(1 2)", &p) == LW_SUCCESS);
473  CU_ASSERT_EQUAL(p.x, 1);
474  CU_ASSERT_EQUAL(p.y, 2);
475 
476  CU_ASSERT(peek2_point_helper("POINTZ(10 20 30)", &p) == LW_SUCCESS);
477  CU_ASSERT_EQUAL(p.x, 10);
478  CU_ASSERT_EQUAL(p.y, 20);
479  CU_ASSERT_EQUAL(p.z, 30);
480 
481  CU_ASSERT(peek2_point_helper("POINTM(100 200 300)", &p) == LW_SUCCESS);
482  CU_ASSERT_EQUAL(p.x, 100);
483  CU_ASSERT_EQUAL(p.y, 200);
484  CU_ASSERT_EQUAL(p.m, 300);
485 
486  CU_ASSERT(peek2_point_helper("POINTZM(1000 2000 3000 4000)", &p) == LW_SUCCESS);
487  CU_ASSERT_EQUAL(p.x, 1000);
488  CU_ASSERT_EQUAL(p.y, 2000);
489  CU_ASSERT_EQUAL(p.z, 3000);
490  CU_ASSERT_EQUAL(p.m, 4000);
491 
492  CU_ASSERT(peek2_point_helper("MULTIPOINT((0 0), (1 1))", &p) == LW_FAILURE);
493  CU_ASSERT(peek2_point_helper("LINESTRING(0 0, 1 1)", &p) == LW_FAILURE);
494  CU_ASSERT(peek2_point_helper("MULTILINESTRING((0 0, 1 1), (0 0, 1 1))", &p) == LW_FAILURE);
495  CU_ASSERT(peek2_point_helper("POLYGON((0 0, 1 1, 1 0, 0 0))", &p) == LW_FAILURE);
496 }
static int peek2_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, peek2_point_helper(), POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by gserialized2_suite_setup().

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