PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ test_misc_count_vertices()

static void test_misc_count_vertices ( void  )
static

Definition at line 52 of file liblwgeom/cunit/cu_misc.c.

53 {
54  LWGEOM *geom;
55  int count;
56 
57  geom = lwgeom_from_wkt("GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,1 1),POLYGON((0 0,0 1,1 0,0 0)),CIRCULARSTRING(0 0,0 1,1 1),CURVEPOLYGON(CIRCULARSTRING(0 0,0 1,1 1)))", LW_PARSER_CHECK_NONE);
59  CU_ASSERT_EQUAL(count,13);
60  lwgeom_free(geom);
61 
62  geom = lwgeom_from_wkt("GEOMETRYCOLLECTION(CIRCULARSTRING(0 0,0 1,1 1),POINT(0 0),CURVEPOLYGON(CIRCULARSTRING(0 0,0 1,1 1,1 0,0 0)))", LW_PARSER_CHECK_NONE);
64  CU_ASSERT_EQUAL(count,9);
65  lwgeom_free(geom);
66 
67  geom = lwgeom_from_wkt("CURVEPOLYGON((0 0,1 0,0 1,0 0),CIRCULARSTRING(0 0,1 0,1 1,1 0,0 0))", LW_PARSER_CHECK_NONE);
69  CU_ASSERT_EQUAL(count,9);
70  lwgeom_free(geom);
71 
72 
73  geom = lwgeom_from_wkt("POLYGON((0 0,1 0,0 1,0 0))", LW_PARSER_CHECK_NONE);
75  CU_ASSERT_EQUAL(count,4);
76  lwgeom_free(geom);
77 
78  geom = lwgeom_from_wkt("CURVEPOLYGON((0 0,1 0,0 1,0 0),CIRCULARSTRING(0 0,1 0,1 1,1 0,0 0))", LW_PARSER_CHECK_NONE);
80  CU_ASSERT_EQUAL(count,9);
81  lwgeom_free(geom);
82 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2085
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1229
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:905
int count
Definition: genraster.py:57

References genraster::count, LW_PARSER_CHECK_NONE, lwgeom_count_vertices(), lwgeom_free(), and lwgeom_from_wkt().

Referenced by misc_suite_setup().

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