PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ assert_string_equal_impl()

static void assert_string_equal_impl ( const char *  obtained,
const char *  expected,
const char *  file,
int  line 
)
inlinestatic

Definition at line 45 of file liblwgeom/cunit/cu_tester.h.

46 {
47  CU_BOOL error = (!obtained && expected) || (obtained && !expected) || (strcmp(obtained, expected) != 0);
48  char *msg = NULL;
49  if (error)
50  {
51  msg = lwalloc(60 + (obtained ? strlen(obtained) : 4) + (expected ? strlen(expected) : 4));
52  sprintf(msg,
53  "ASSERT_STRING_EQUAL\n\t* Expected: %s\n\t* Obtained: %s",
54  expected ? expected : "NULL",
55  obtained ? obtained : "NULL");
56  }
57  CU_assertImplementation(!error, line, msg, file, NULL, CU_FALSE);
58  if (msg)
59  lwfree(msg);
60 }
void lwfree(void *mem)
Definition: lwutil.c:242
void * lwalloc(size_t size)
Definition: lwutil.c:227

References lwalloc(), and lwfree().

Here is the call graph for this function: