12 #include "CUnit/Basic.h"
14 #include "../liblwgeom_internal.h"
19 CU_ASSERT_TRUE(
result != NULL);
25 char *msg1 =
"mbc_test failed (got %.12f should be less than radius %.12f) \n";
35 if ( (d -
result->radius) > 0.0000001 )
37 printf(msg1, d,
result->radius);
56 "POLYGON((26426 65078,26531 65242,26075 65136,26096 65427,26426 65078))",
58 "TRIANGLE ((0 0, 10 0, 10 10, 0 0))",
59 "LINESTRING (17 253, -44 28, 33 11, 26 44)",
60 "MULTIPOINT ((0 0), (0 0), (0 0), (0 0))",
61 "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))",
62 "LINESTRING (-48546889 37039202, -37039202 -48546889)"
79 CU_ASSERT_TRUE(
result == NULL);
90 CU_pSuite suite = CU_add_suite(
"minimum_bounding_circle", NULL, NULL);
static void test_empty(void)
void minimum_bounding_circle_suite_setup(void)
static void mbc_test(LWGEOM *g)
static void basic_test(void)
char result[OUT_DOUBLE_BUFFER_SIZE]
#define PG_ADD_TEST(suite, testfunc)
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
LWPOINTITERATOR * lwpointiterator_create(const LWGEOM *g)
Create a new LWPOINTITERATOR over supplied LWGEOM*.
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
int lwpointiterator_next(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assign the next point in the iterator to p, and advances the iterator to the next point.
void lwpointiterator_destroy(LWPOINTITERATOR *s)
Free all memory associated with the iterator.
LWBOUNDINGCIRCLE * lwgeom_calculate_mbc(const LWGEOM *g)
void lwboundingcircle_destroy(LWBOUNDINGCIRCLE *c)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)