This repository has been archived on 2017-07-22. You can view files and clone it, but cannot push or open issues/pull-requests.
jlsampler/jl_test.h

30 lines
1007 B
C

/*****************************************************************************
* VERSION: 1.00
* 2015-08-25
*
* Testing macros.
*****************************************************************************/
#ifndef JLLIB_TEST_HEADER_
#define JLLIB_TEST_HEADER_
#include <stdio.h>
#define JL_TEST_FUNC printf("Running: %s\n", __func__)
#define JL_FAIL_MSG(msg) \
do { \
printf(" FAILED: %s() line %d\n", __func__, __LINE__); \
printf(" %s\n", msg); \
exit(EXIT_FAILURE); \
} while (0)
#define JL_FAIL_IF(cond, msg) \
do { \
if(cond) { \
JL_FAIL_MSG(msg); \
} \
} while (0)
#endif // JLLIB_TEST_HEADER_