13 #include "CUnit/Basic.h" 22 char *exp_wkt, *obt_wkt;
27 CU_ASSERT_FATAL(geom != NULL);
29 CU_ASSERT_FATAL(ret != NULL);
31 exp_wkt =
"POLYGON EMPTY";
40 CU_ASSERT_FATAL(geom != NULL);
42 CU_ASSERT_FATAL(ret != NULL);
44 exp_wkt =
"POINT(10 0)";
53 CU_ASSERT_FATAL(geom != NULL);
55 CU_ASSERT_FATAL(ret != NULL);
57 exp_wkt =
"POINT(0 0)";
66 CU_ASSERT_FATAL(geom != NULL);
68 CU_ASSERT_FATAL(ret != NULL);
70 exp_wkt =
"POINT(0 0)";
77 "LINESTRING(0 0,10 0)",
79 CU_ASSERT_FATAL(geom != NULL);
81 CU_ASSERT_FATAL(ret != NULL);
83 exp_wkt =
"MULTILINESTRING((0 0,8 0),(-2 0,0 0))";
90 "MULTILINESTRING((-5 -2,0 0),(0 0,10 10))",
92 CU_ASSERT_FATAL(geom != NULL);
94 CU_ASSERT_FATAL(ret != NULL);
96 exp_wkt =
"MULTILINESTRING((15 -2,20 0),(0 0,10 10))";
104 " ((0 0,10 0,10 10,0 10,0 0),(2 2,4 2,4 4,2 4,2 2))," 105 " ((0 11,10 11,10 21,0 21,0 11),(2 13,4 13,4 15,2 15,2 13))" 108 CU_ASSERT_FATAL(geom != NULL);
110 CU_ASSERT_FATAL(ret != NULL);
112 exp_wkt =
"GEOMETRYCOLLECTION(" 114 "((22 0,20 0,20 10,22 10,22 4,22 2,22 0))," 115 "((2 10,10 10,10 0,2 0,2 2,4 2,4 4,2 4,2 10))" 118 "((22 11,20 11,20 21,22 21,22 15,22 13,22 11))," 119 "((2 21,10 21,10 11,2 11,2 13,4 13,4 15,2 15,2 21))" 128 "GEOMETRYCOLLECTION(" 129 " MULTILINESTRING((-5 -2,0 0),(0 0,10 10))," 134 CU_ASSERT_FATAL(geom != NULL);
136 CU_ASSERT_FATAL(ret != NULL);
138 exp_wkt =
"GEOMETRYCOLLECTION(" 139 "MULTILINESTRING((15 -2,20 0),(0 0,10 10))," 157 CU_pSuite suite = CU_add_suite(
"wrapx", NULL, NULL);
static void test_lwgeom_wrapx(void)
#define ASSERT_STRING_EQUAL(o, e)
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_wrapx(const LWGEOM *lwgeom, double cutx, double amount)
wrap geometry on given cut x value
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
#define LW_PARSER_CHECK_NONE
#define PG_ADD_TEST(suite, testfunc)
void wrapx_suite_setup(void)
This library is the generic geometry handling section of PostGIS.