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

Definition at line 158 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().

159 {
160  LWGEOM *g;
161  size_t size = 0;
162 
163  g = lwgeom_from_wkt("POINT(0 0)", LW_PARSER_CHECK_NONE);
165  CU_ASSERT_EQUAL( size, 32 );
166  lwgeom_free(g);
167 
168  g = lwgeom_from_wkt("POINT(0 0 0)", LW_PARSER_CHECK_NONE);
170  CU_ASSERT_EQUAL( size, 40 );
171  lwgeom_free(g);
172 
173  g = lwgeom_from_wkt("MULTIPOINT(0 0 0, 1 1 1)", LW_PARSER_CHECK_NONE);
175  CU_ASSERT_EQUAL( size, 80 );
176  lwgeom_free(g);
177 
178  g = lwgeom_from_wkt("LINESTRING(0 0, 1 1)", LW_PARSER_CHECK_NONE);
180  CU_ASSERT_EQUAL( size, 48 );
181  lwgeom_free(g);
182 
183  g = lwgeom_from_wkt("MULTILINESTRING((0 0, 1 1),(0 0, 1 1))", LW_PARSER_CHECK_NONE);
185  CU_ASSERT_EQUAL( size, 96 );
186  lwgeom_free(g);
187 
188  g = lwgeom_from_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", LW_PARSER_CHECK_NONE);
190  CU_ASSERT_EQUAL( size, 104 );
191  lwgeom_free(g);
192 
193  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);
195  CU_ASSERT_EQUAL( size, 184 );
196  lwgeom_free(g);
197 
198 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:890
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1869
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:539

Here is the call graph for this function:

Here is the caller graph for this function: