PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_ptarray_append_point()

static void test_ptarray_append_point ( void  )
static

Definition at line 37 of file cu_ptarray.c.

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

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 }
double x
Definition: liblwgeom.h:352
void lwfree(void *mem)
Definition: lwutil.c:244
#define ASSERT_STRING_EQUAL(o, e)
void lwline_free(LWLINE *line)
Definition: lwline.c:76
static LWGEOM * lwgeom_from_text(const char *str)
Definition: cu_ptarray.c:24
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:298
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, then a duplicate point will not be added.
Definition: ptarray.c:156
#define LW_FALSE
Definition: liblwgeom.h:77
static char * lwgeom_to_text(const LWGEOM *geom)
Definition: cu_ptarray.c:32
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
Definition: lwgeom.c:138
double y
Definition: liblwgeom.h:352
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: