1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <setjmp.h> #include "test.h" void test_setjmp_h(void) { jmp_buf jb; int r; int expected = 0; testing_header("setjmp.h"); r = setjmp(jb); test_int_equals(r, expected); if (r == 0) { expected = 1; longjmp(jb, 1); } testing_end(); }