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

Definition at line 149 of file cu_libgeom.c.

References gserialized_from_lwgeom_size(), LW_PARSER_CHECK_NONE, lwgeom_free(), and lwgeom_from_wkt().

Referenced by libgeom_suite_setup().

150 {
151  LWGEOM *g;
152  size_t size = 0;
153 
154  g = lwgeom_from_wkt("POINT(0 0)", LW_PARSER_CHECK_NONE);
156  CU_ASSERT_EQUAL( size, 32 );
157  lwgeom_free(g);
158 
159  g = lwgeom_from_wkt("POINT(0 0 0)", LW_PARSER_CHECK_NONE);
161  CU_ASSERT_EQUAL( size, 40 );
162  lwgeom_free(g);
163 
164  g = lwgeom_from_wkt("MULTIPOINT(0 0 0, 1 1 1)", LW_PARSER_CHECK_NONE);
166  CU_ASSERT_EQUAL( size, 80 );
167  lwgeom_free(g);
168 
169  g = lwgeom_from_wkt("LINESTRING(0 0, 1 1)", LW_PARSER_CHECK_NONE);
171  CU_ASSERT_EQUAL( size, 48 );
172  lwgeom_free(g);
173 
174  g = lwgeom_from_wkt("MULTILINESTRING((0 0, 1 1),(0 0, 1 1))", LW_PARSER_CHECK_NONE);
176  CU_ASSERT_EQUAL( size, 96 );
177  lwgeom_free(g);
178 
179  g = lwgeom_from_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", LW_PARSER_CHECK_NONE);
181  CU_ASSERT_EQUAL( size, 104 );
182  lwgeom_free(g);
183 
184  g = lwgeom_from_wkt("POLYGON((-1 -1, -1 2, 2 2, 2 -1, -1 -1), (0 0, 0 1, 1 1, 1 0, 0 0))", LW_PARSER_CHECK_NONE);
186  CU_ASSERT_EQUAL( size, 184 );
187  lwgeom_free(g);
188 
189 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
size_t gserialized_from_lwgeom_size(const LWGEOM *geom)
Calculate required memory segment to contain a serialized form of the LWGEOM.
Definition: g_serialized.c:541

Here is the call graph for this function:

Here is the caller graph for this function: