Fixed UB introduced by the previous commit
This commit is contained in:
parent
7577cf8940
commit
ee1828ff46
1 changed files with 6 additions and 6 deletions
12
src/runner.c
12
src/runner.c
|
@ -58,7 +58,7 @@ IMPL_SECTION_LIMITS(struct criterion_suite, cr_sts);
|
|||
TestSuite();
|
||||
Test(,) {};
|
||||
|
||||
static INLINE void nothing() {}
|
||||
static INLINE void nothing(void) {}
|
||||
|
||||
int cmp_suite(void *a, void *b) {
|
||||
struct criterion_suite *s1 = a, *s2 = b;
|
||||
|
@ -169,14 +169,14 @@ static void run_test_child(struct criterion_test *test,
|
|||
|
||||
send_event(PRE_INIT, NULL, 0);
|
||||
if (suite->data)
|
||||
suite->data->init ? suite->data->init() : nothing();
|
||||
test->data->init ? test->data->init() : nothing();
|
||||
(suite->data->init ? suite->data->init : nothing)();
|
||||
(test->data->init ? test->data->init : nothing)();
|
||||
send_event(PRE_TEST, NULL, 0);
|
||||
|
||||
struct timespec_compat ts;
|
||||
if (setup_abort_test()) {
|
||||
timer_start(&ts);
|
||||
test->test ? test->test() : nothing();
|
||||
(test->test ? test->test : nothing)();
|
||||
}
|
||||
|
||||
double elapsed_time;
|
||||
|
@ -184,9 +184,9 @@ static void run_test_child(struct criterion_test *test,
|
|||
elapsed_time = -1;
|
||||
|
||||
send_event(POST_TEST, &elapsed_time, sizeof (double));
|
||||
test->data->fini ? test->data->fini() : nothing();
|
||||
(test->data->fini ? test->data->fini : nothing)();
|
||||
if (suite->data)
|
||||
suite->data->fini ? suite->data->fini() : nothing();
|
||||
(suite->data->fini ? suite->data->fini : nothing)();
|
||||
send_event(POST_FINI, NULL, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue