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 ) {
int expected
Expected value.
#define longjmp_ok(test, value)
static void setjmp_return_ok(struct setjmp_test *test, int value)
Report a setjmp()/longjmp() test result.
static void longjmp_okx(struct setjmp_test *test, int value, const char *file, unsigned int line)
Report a longjmp() test result.
Self-test infrastructure.
const char * name
Test set name.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define setjmp_ok(test)
Report a setjmp() test result.
static struct setjmp_test * jumped
Expected jump.
A setjmp()/longjmp() test.
#define okx(success, file, line)
Report test result.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
pseudo_bit_t value[0x00020]
struct self_test setjmp_test __self_test
setjmp()/longjmp() self-test
unsigned int line
Test code line.
static void setjmp_test_exec(void)
Perform setjmp()/longjmp() self-tests.
const char * file
Test code file.
#define NULL
NULL pointer (VOID *)