PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_lwprint_assert_format()

static void test_lwprint_assert_format ( char *  point_wkt,
const char *  format,
const char *  expected 
)
static

Definition at line 20 of file cu_print.c.

21 {
22  LWPOINT * test_point = (LWPOINT*)lwgeom_from_wkt(point_wkt, LW_PARSER_CHECK_NONE);
23  int num_old_failures, num_new_failures;
24  char * actual;
26  actual = lwpoint_to_latlon(test_point, format);
27  if (0 != strlen(cu_error_msg))
28  {
29  printf("\nAssert failed:\n\tFormat [%s] generated an error: %s\n", format, cu_error_msg);
30  CU_FAIL();
31  }
32  num_old_failures = CU_get_number_of_failures();
33  CU_ASSERT_STRING_EQUAL(actual, expected);
34  num_new_failures = CU_get_number_of_failures();
35  if (num_new_failures > num_old_failures)
36  {
37  printf("\nAssert failed:\n\t%s\t(actual)\n\t%s\t(expected)\n", actual, expected);
38  }
39  lwfree(actual);
40  lwpoint_free(test_point);
41 }
void cu_error_msg_reset()
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]
void lwpoint_free(LWPOINT *pt)
Definition: lwpoint.c:213
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2005
void lwfree(void *mem)
Definition: lwutil.c:244
char * lwpoint_to_latlon(const LWPOINT *p, const char *format)
Definition: lwprint.c:426
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904

References cu_error_msg, cu_error_msg_reset(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_from_wkt(), lwpoint_free(), and lwpoint_to_latlon().

Referenced by test_lwprint_default_format(), test_lwprint_format_orders(), test_lwprint_oddball_formats(), and test_lwprint_optional_format().

Here is the call graph for this function:
Here is the caller graph for this function: