~dave-terei/libmemcached/sasl-fixes

« back to all changes in this revision

Viewing changes to libtest/test.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
  } \
218
218
} while (0)
219
219
 
 
220
#define test_compare(A,B) \
 
221
do \
 
222
{ \
 
223
  if ((A) != (B)) \
 
224
  { \
 
225
    fprintf(stderr, "\n%s:%d: Expected %lu == %lu\n", __FILE__, __LINE__, (unsigned long)(A), (unsigned long)(B)); \
 
226
    create_core(); \
 
227
    return TEST_FAILURE; \
 
228
  } \
 
229
} while (0)
 
230
 
220
231
#define test_false(A) \
221
232
do \
222
233
{ \
248
259
  } \
249
260
} while (0)
250
261
 
 
262
#define test_memcmp(A,B,C) \
 
263
do \
 
264
{ \
 
265
  if (memcmp((A), (B), (C))) \
 
266
  { \
 
267
    fprintf(stderr, "\n%s:%d: %.*s -> %.*s\n", __FILE__, __LINE__, (int)(C), (char *)(A), (int)(C), (char *)(B)); \
 
268
    create_core(); \
 
269
    return TEST_FAILURE; \
 
270
  } \
 
271
} while (0)
251
272
 
252
273
#define STRINGIFY(x) #x
253
274
#define TOSTRING(x) STRINGIFY(x)