1152 LWPOINT* expected_result = NULL;
1160 if (expected != NULL)
1170 if (result != NULL && expected != NULL)
1180 passed &= fabs(actual_pt.
x - expected_pt.
x) < tolerance;
1181 passed &= fabs(actual_pt.
y - expected_pt.
y) < tolerance;
1182 passed &= (!
lwgeom_has_z((
LWGEOM*) expected_result) || fabs(actual_pt.
z - expected_pt.
z) < tolerance);
1183 passed &= (!
lwgeom_has_m((
LWGEOM*) expected_result) || fabs(actual_pt.
m - expected_pt.
m) < tolerance);
1195 passed = distance_result <= (1.0 + tolerance) * distance_expected;
1198 printf(
"Diff: Got %.10f Expected %.10f\n", distance_result, distance_expected);
1206 printf(
"median_test input %s (parsed %s) expected %s got %s\n",
1213 else if (result == NULL && expected == NULL)
1217 else if (result != NULL && expected == NULL)
1222 else if (result == NULL && expected != NULL)
1229 CU_ASSERT_TRUE(passed);
static double test_weighted_distance(const POINT4D *curr, const POINT4D *points, uint32_t npoints)
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
int lwpoint_getPoint4d_p(const LWPOINT *point, POINT4D *out)
LWMPOINT * lwgeom_as_lwmpoint(const LWGEOM *lwgeom)
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
LWPOINT * lwgeom_median(const LWGEOM *g, double tol, uint32_t maxiter, char fail_if_not_converged)
#define LW_TRUE
Return types for functions with status returns.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
POINT4D * lwmpoint_extract_points_4d(const LWMPOINT *g, uint32_t *npoints, int *input_empty)
#define FP_TOLERANCE
Floating point comparators.