PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_ptarray_append_point()

static void test_ptarray_append_point ( void  )
static

Definition at line 37 of file cu_ptarray.c.

38 {
39  LWLINE *line;
40  char *wkt;
41  POINT4D p;
42 
43  line = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(0 0,1 1)"));
44  p.x = 1;
45  p.y = 1;
47  wkt = lwgeom_to_text(lwline_as_lwgeom(line));
48  ASSERT_STRING_EQUAL(wkt,"LINESTRING(0 0,1 1,1 1)");
49  lwfree(wkt);
50 
52  wkt = lwgeom_to_text(lwline_as_lwgeom(line));
53  ASSERT_STRING_EQUAL(wkt,"LINESTRING(0 0,1 1,1 1)");
54  lwfree(wkt);
55 
56  lwline_free(line);
57 }
static char * lwgeom_to_text(const LWGEOM *geom)
Definition: cu_ptarray.c:32
static LWGEOM * lwgeom_from_text(const char *str)
Definition: cu_ptarray.c:24
#define ASSERT_STRING_EQUAL(o, e)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
Definition: lwgeom.c:170
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
#define LW_FALSE
Definition: liblwgeom.h:77
void lwfree(void *mem)
Definition: lwutil.c:244
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
Definition: ptarray.c:156
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
void lwline_free(LWLINE *line)
Definition: lwline.c:76
POINTARRAY * points
Definition: liblwgeom.h:425
double x
Definition: liblwgeom.h:355
double y
Definition: liblwgeom.h:355

References ASSERT_STRING_EQUAL, LW_FALSE, LW_TRUE, lwfree(), lwgeom_as_lwline(), lwgeom_from_text(), lwgeom_to_text(), lwline_as_lwgeom(), lwline_free(), LWLINE::points, ptarray_append_point(), POINT4D::x, and POINT4D::y.

Referenced by ptarray_suite_setup().

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