PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_geos_linemerge()

static void test_geos_linemerge ( void  )
static

Definition at line 68 of file cu_geos.c.

69 {
70  char *ewkt;
71  char *out_ewkt;
72  LWGEOM *geom1;
73  LWGEOM *geom2;
74 
75  ewkt = "MULTILINESTRING((0 0, 0 100),(0 -5, 0 0))";
77  geom2 = lwgeom_linemerge(geom1);
78  out_ewkt = lwgeom_to_ewkt((LWGEOM*)geom2);
79  ASSERT_STRING_EQUAL(out_ewkt, "LINESTRING(0 -5,0 0,0 100)");
80  lwfree(out_ewkt);
81  lwgeom_free(geom1);
82  lwgeom_free(geom2);
83 
84  ewkt = "MULTILINESTRING EMPTY";
86  geom2 = lwgeom_linemerge(geom1);
87  out_ewkt = lwgeom_to_ewkt((LWGEOM*)geom2);
88  ASSERT_STRING_EQUAL(out_ewkt, "MULTILINESTRING EMPTY");
89  lwfree(out_ewkt);
90  lwgeom_free(geom1);
91  lwgeom_free(geom2);
92 }
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2005
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:556
void lwfree(void *mem)
Definition: lwutil.c:244
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
LWGEOM * lwgeom_linemerge(const LWGEOM *geom1)

References ASSERT_STRING_EQUAL, LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_linemerge(), and lwgeom_to_ewkt().

Referenced by geos_suite_setup().

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