PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_gserialized2_peek_first_point()

static void test_gserialized2_peek_first_point ( void  )
static

Definition at line 482 of file cu_gserialized2.c.

483{
484 POINT4D p = {0};
485
486 CU_ASSERT(peek2_point_helper("POINT(1 2)", &p) == LW_SUCCESS);
487 CU_ASSERT_EQUAL(p.x, 1);
488 CU_ASSERT_EQUAL(p.y, 2);
489
490 CU_ASSERT(peek2_point_helper("POINTZ(10 20 30)", &p) == LW_SUCCESS);
491 CU_ASSERT_EQUAL(p.x, 10);
492 CU_ASSERT_EQUAL(p.y, 20);
493 CU_ASSERT_EQUAL(p.z, 30);
494
495 CU_ASSERT(peek2_point_helper("POINTM(100 200 300)", &p) == LW_SUCCESS);
496 CU_ASSERT_EQUAL(p.x, 100);
497 CU_ASSERT_EQUAL(p.y, 200);
498 CU_ASSERT_EQUAL(p.m, 300);
499
500 CU_ASSERT(peek2_point_helper("POINTZM(1000 2000 3000 4000)", &p) == LW_SUCCESS);
501 CU_ASSERT_EQUAL(p.x, 1000);
502 CU_ASSERT_EQUAL(p.y, 2000);
503 CU_ASSERT_EQUAL(p.z, 3000);
504 CU_ASSERT_EQUAL(p.m, 4000);
505
506 CU_ASSERT(peek2_point_helper("MULTIPOINT((0 0), (1 1))", &p) == LW_FAILURE);
507 CU_ASSERT(peek2_point_helper("LINESTRING(0 0, 1 1)", &p) == LW_FAILURE);
508 CU_ASSERT(peek2_point_helper("MULTILINESTRING((0 0, 1 1), (0 0, 1 1))", &p) == LW_FAILURE);
509 CU_ASSERT(peek2_point_helper("POLYGON((0 0, 1 1, 1 0, 0 0))", &p) == LW_FAILURE);
510}
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: