[Issue #46] Fixed wrong setjmp usage

This commit is contained in:
Snaipe 2015-09-18 05:15:17 -07:00
parent d75eb4f038
commit 4e5d416114
3 changed files with 1 additions and 7 deletions

View file

@ -25,10 +25,6 @@
jmp_buf g_pre_test;
int setup_abort_test(void) {
return !setjmp(g_pre_test);
}
void criterion_abort_test(void) {
longjmp(g_pre_test, 1);
}

View file

@ -29,6 +29,4 @@
extern jmp_buf g_pre_test;
int setup_abort_test(void);
#endif /* !ABORT_H_ */

View file

@ -184,7 +184,7 @@ static void run_test_child(struct criterion_test *test,
send_event(PRE_TEST, NULL, 0);
struct timespec_compat ts;
if (setup_abort_test()) {
if (!setjmp(g_pre_test)) {
timer_start(&ts);
(test->test ? test->test : nothing)();
}