Skip to content

Commit

Permalink
scan-build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored and sheredom committed Jul 27, 2023
1 parent ad28a41 commit 0fd26e3
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions utest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,10 @@ utest_type_printer(long long unsigned int i) {
utest_state.tests[index].func = &utest_##SET##_##NAME; \
utest_state.tests[index].name = name; \
utest_state.tests[index].index = 0; \
UTEST_SNPRINTF(name, name_size, "%s", name_part); \
} else if (name) { \
free(name); \
} \
UTEST_SNPRINTF(name, name_size, "%s", name_part); \
} \
void utest_run_##SET##_##NAME(int *utest_result)

Expand Down Expand Up @@ -1163,9 +1165,13 @@ utest_type_printer(long long unsigned int i) {
utest_realloc(UTEST_PTR_CAST(void *, utest_state.tests), \
sizeof(struct utest_test_state_s) * \
utest_state.tests_length)); \
utest_state.tests[index].func = &utest_f_##FIXTURE##_##NAME; \
utest_state.tests[index].name = name; \
UTEST_SNPRINTF(name, name_size, "%s", name_part); \
if (utest_state.tests) { \
utest_state.tests[index].func = &utest_f_##FIXTURE##_##NAME; \
utest_state.tests[index].name = name; \
UTEST_SNPRINTF(name, name_size, "%s", name_part); \
} else if (name) { \
free(name); \
} \
} \
UTEST_FIXTURE_SURPRESS_WARNINGS_END \
void utest_run_##FIXTURE##_##NAME(int *utest_result, \
Expand Down Expand Up @@ -1206,11 +1212,15 @@ utest_type_printer(long long unsigned int i) {
utest_realloc(UTEST_PTR_CAST(void *, utest_state.tests), \
sizeof(struct utest_test_state_s) * \
utest_state.tests_length)); \
utest_state.tests[index].func = &utest_i_##FIXTURE##_##NAME##_##INDEX; \
utest_state.tests[index].index = i; \
utest_state.tests[index].name = name; \
iUp = UTEST_CAST(utest_uint64_t, i); \
UTEST_SNPRINTF(name, name_size, "%s/%" UTEST_PRIu64, name_part, iUp); \
if (utest_state.tests) { \
utest_state.tests[index].func = &utest_i_##FIXTURE##_##NAME##_##INDEX; \
utest_state.tests[index].index = i; \
utest_state.tests[index].name = name; \
iUp = UTEST_CAST(utest_uint64_t, i); \
UTEST_SNPRINTF(name, name_size, "%s/%" UTEST_PRIu64, name_part, iUp); \
} else if (name) { \
free(name); \
} \
} \
} \
void utest_run_##FIXTURE##_##NAME##_##INDEX(int *utest_result, \
Expand Down

0 comments on commit 0fd26e3

Please sign in to comment.