Skip to content

Commit

Permalink
[Issue #46] Fixed wrong setjmp usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Sep 19, 2015
1 parent d75eb4f commit 4e5d416
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions src/abort.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 0 additions & 2 deletions src/abort.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@

extern jmp_buf g_pre_test;

int setup_abort_test(void);

#endif /* !ABORT_H_ */
2 changes: 1 addition & 1 deletion src/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
}
Expand Down

0 comments on commit 4e5d416

Please sign in to comment.