PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void test_ptarray_append_point ( void  )
static

Definition at line 38 of file cu_ptarray.c.

References 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().

39 {
40  LWLINE *line;
41  char *wkt;
42  POINT4D p;
43 
44  line = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(0 0,1 1)"));
45  p.x = 1;
46  p.y = 1;
48  wkt = lwgeom_to_text(lwline_as_lwgeom(line));
49  CU_ASSERT_STRING_EQUAL(wkt,"LINESTRING(0 0,1 1,1 1)");
50  lwfree(wkt);
51 
53  wkt = lwgeom_to_text(lwline_as_lwgeom(line));
54  CU_ASSERT_STRING_EQUAL(wkt,"LINESTRING(0 0,1 1,1 1)");
55  lwfree(wkt);
56 
57  lwline_free(line);
58 }
double x
Definition: liblwgeom.h:308
void lwfree(void *mem)
Definition: lwutil.c:190
void lwline_free(LWLINE *line)
Definition: lwline.c:63
static LWGEOM * lwgeom_from_text(const char *str)
Definition: cu_ptarray.c:25
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:249
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_TRUE, then a duplicate point will not be added.
Definition: ptarray.c:141
#define LW_FALSE
Definition: liblwgeom.h:52
static char * lwgeom_to_text(const LWGEOM *geom)
Definition: cu_ptarray.c:33
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
Definition: lwgeom.c:89
double y
Definition: liblwgeom.h:308
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: