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

◆ test_gserialized1_peek_first_point()

static void test_gserialized1_peek_first_point ( void  )
static

Definition at line 1229 of file cu_gserialized1.c.

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

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: