15 #define MAX_CUNIT_ERROR_LENGTH 512 17 #define PG_ADD_TEST(suite, testfunc) CU_add_test(suite, #testfunc, testfunc) 28 #define ASSERT_DOUBLE_EQUAL(o,e) do { \ 30 fprintf(stderr, "[%s:%d]\n Expected: %g\n Obtained: %g\n", __FILE__, __LINE__, (double)(e), (o)); \ 31 CU_ASSERT_EQUAL(o,(double)e); \ 34 #define ASSERT_INT_EQUAL(o,e) do { \ 36 fprintf(stderr, "[%s:%d]\n Expected: %d\n Obtained: %d\n", __FILE__, __LINE__, (e), (o)); \ 37 CU_ASSERT_EQUAL(o,e); \ 40 #define ASSERT_STRING_EQUAL(o,e) do { \ 41 if ( strcmp(o,e) != 0 ) \ 42 fprintf(stderr, "[%s:%d]\n Expected: %s\n Obtained: %s\n", __FILE__, __LINE__, (e), (o)); \ 43 CU_ASSERT_STRING_EQUAL(o,e); \ 46 #define ASSERT_LWGEOM_EQUAL(o, e) do { \ 47 if ( !lwgeom_same(o, e) ) { \ 48 char* wkt_o = lwgeom_to_ewkt(o); \ 49 char* wkt_e = lwgeom_to_ewkt(e); \ 50 fprintf(stderr, "[%s:%d]\n Expected: %s\n Obtained: %s\n", __FILE__, __LINE__, (wkt_o), (wkt_e)); \ 54 CU_ASSERT_TRUE(lwgeom_same(o, e)); \ 57 #define ASSERT_INTARRAY_EQUAL(o, e, n) do { \ 59 for (i = 0; i < n; i++) { \ 61 fprintf(stderr, "[%s:%d]", __FILE__, __LINE__); \ 62 fprintf(stderr, "\nExpected: ["); \ 63 for (i = 0; i < n; i++) \ 64 fprintf(stderr, " %d", e[i]); \ 65 fprintf(stderr, " ]\nObtained: ["); \ 66 for (i = 0; i < n; i++) \ 67 fprintf(stderr, " %d", o[i]); \ 68 fprintf(stderr, " ]\n"); \ void cu_error_msg_reset(void)
void(* PG_SuiteSetup)(void)
void do_fn_test(LWGEOM *(*transfn)(LWGEOM *), char *input_wkt, char *expected_wkt)
#define MAX_CUNIT_ERROR_LENGTH
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
This library is the generic geometry handling section of PostGIS.