PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_gserialized_from_lwgeom_size()

static void test_gserialized_from_lwgeom_size ( void  )
static

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

160 {
161  LWGEOM *g;
162  size_t size = 0;
163 
164  g = lwgeom_from_wkt("POINT(0 0)", LW_PARSER_CHECK_NONE);
166  CU_ASSERT_EQUAL( size, 32 );
167  lwgeom_free(g);
168 
169  g = lwgeom_from_wkt("POINT(0 0 0)", LW_PARSER_CHECK_NONE);
171  CU_ASSERT_EQUAL( size, 40 );
172  lwgeom_free(g);
173 
174  g = lwgeom_from_wkt("MULTIPOINT(0 0 0, 1 1 1)", LW_PARSER_CHECK_NONE);
176  CU_ASSERT_EQUAL( size, 80 );
177  lwgeom_free(g);
178 
179  g = lwgeom_from_wkt("LINESTRING(0 0, 1 1)", LW_PARSER_CHECK_NONE);
181  CU_ASSERT_EQUAL( size, 48 );
182  lwgeom_free(g);
183 
184  g = lwgeom_from_wkt("MULTILINESTRING((0 0, 1 1),(0 0, 1 1))", LW_PARSER_CHECK_NONE);
186  CU_ASSERT_EQUAL( size, 96 );
187  lwgeom_free(g);
188 
189  g = lwgeom_from_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", LW_PARSER_CHECK_NONE);
191  CU_ASSERT_EQUAL( size, 104 );
192  lwgeom_free(g);
193 
194  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);
196  CU_ASSERT_EQUAL( size, 184 );
197  lwgeom_free(g);
198 
199 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2013
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:810
Here is the call graph for this function:
Here is the caller graph for this function: