iPXE
|
setjmp()/longjmp() tests More...
Go to the source code of this file.
Data Structures | |
struct | setjmp_test |
A setjmp()/longjmp() test. More... | |
Macros | |
#define | setjmp_ok(test) |
Report a setjmp() test result. More... | |
#define | longjmp_ok(test, value) longjmp_okx ( test, value, __FILE__, __LINE__ ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | setjmp_return_ok (struct setjmp_test *test, int value) |
Report a setjmp()/longjmp() test result. More... | |
static void | longjmp_okx (struct setjmp_test *test, int value, const char *file, unsigned int line) |
Report a longjmp() test result. More... | |
static void | setjmp_test_exec (void) |
Perform setjmp()/longjmp() self-tests. More... | |
Variables | |
static struct setjmp_test * | jumped |
Expected jump. More... | |
struct self_test setjmp_test | __self_test |
setjmp()/longjmp() self-test More... | |
setjmp()/longjmp() tests
Definition in file setjmp_test.c.
#define setjmp_ok | ( | test | ) |
Report a setjmp() test result.
test | setjmp()/longjmp() test |
This has to be implemented as a macro since if it were a function then the context saved by setjmp() would be invalidated when the function returned.
Definition at line 64 of file setjmp_test.c.
#define longjmp_ok | ( | test, | |
value | |||
) | longjmp_okx ( test, value, __FILE__, __LINE__ ) |
Definition at line 136 of file setjmp_test.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Report a setjmp()/longjmp() test result.
test | setjmp()/longjmp() test |
value | Value returned from setjmp() |
This function ends up reporting results from either setjmp() or longjmp() tests (since calls to longjmp() will return via the corresponding setjmp()). It therefore uses the test code file and line stored in the test structure, which will represent the line from which either setjmp() or longjmp() was called.
Definition at line 90 of file setjmp_test.c.
|
static |
Report a longjmp() test result.
test | setjmp()/longjmp() test |
file | Test code file |
line | Test code line |
Definition at line 115 of file setjmp_test.c.
References assert(), setjmp_test::file, jumped, setjmp_test::line, test, and value.
|
static |
Perform setjmp()/longjmp() self-tests.
Definition at line 143 of file setjmp_test.c.
References DBGC, jumped, longjmp_ok, and setjmp_ok.
|
static |
Expected jump.
Definition at line 53 of file setjmp_test.c.
Referenced by longjmp_okx(), setjmp_return_ok(), and setjmp_test_exec().
struct self_test setjmp_test __self_test |
setjmp()/longjmp() self-test
Definition at line 169 of file setjmp_test.c.