64#define setjmp_ok( test ) do { \
67 assert ( jumped == NULL ); \
69 (test)->expected = 0; \
70 (test)->file = __FILE__; \
71 (test)->line = __LINE__; \
73 value = setjmp ( (test)->env ); \
75 setjmp_return_ok ( (test), value ); \
116 const
char *
file,
unsigned int line ) {
136#define longjmp_ok( test, value ) \
137 longjmp_okx ( test, value, __FILE__, __LINE__ )
146 static int iteration;
151 for ( iteration = 0 ; iteration < 10 ; iteration++ ) {
152 DBGC (
jumped,
"SETJMP test iteration %d\n", iteration );
153 switch ( iteration ) {
#define NULL
NULL pointer (VOID *)
pseudo_bit_t value[0x00020]
#define assert(condition)
Assert a condition at run-time.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define setjmp_ok(test)
Report a setjmp() test result.
static struct setjmp_test * jumped
Expected jump.
#define longjmp_ok(test, value)
static void longjmp_okx(struct setjmp_test *test, int value, const char *file, unsigned int line)
Report a longjmp() test result.
static void setjmp_test_exec(void)
Perform setjmp()/longjmp() self-tests.
static void setjmp_return_ok(struct setjmp_test *test, int value)
Report a setjmp()/longjmp() test result.
A setjmp()/longjmp() test.
int expected
Expected value.
const char * file
Test code file.
unsigned int line
Test code line.
Self-test infrastructure.
#define okx(success, file, line)
Report test result.
#define __self_test
Declare a self-test.