123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- if (!(test)) {\
- fprintf(\
- stderr, "!!! Assertion failed at %s:%d. Message: %s\n", \
- __FILE__, __LINE__, msg); \
- return -1; \
- }\
- } while (0)
- if ((exp) != (got)) {\
- fprintf(\
- stderr, "!!! Test failed at %s:%d. Expected: %lu; got: %lu\n",\
- __FILE__, __LINE__, (size_t)(exp), (size_t)(got)); \
- return -1; \
- }\
- } while (0)
- const char *_str1 = (exp); \
- const char *_str2 = (got); \
- if (((_str1 == NULL) ^ (_str2 == NULL)) || strcmp(_str1, _str2) != 0) {\
- fprintf(\
- stderr, "!!! Test failed at %s:%d. Expected: %s; got: %s\n", \
- __FILE__, __LINE__, (exp), (got)); \
- return -1; \
- }\
- } while (0)
- int rc = (exp); \
- if (rc != LSUP_OK) {\
- fprintf(\
- stderr, "!!! Test failed at %s:%d. Error: %s (%d)\n",\
- __FILE__, __LINE__, LSUP_strerror(rc), rc); \
- return -1; \
- }\
- } while (0)
- if (rc != 0) return -1; } while (0)
- int tests_run;
|