Skip to content

tests: remove unused variables #89196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

majunkier
Copy link
Collaborator

Commit " 78b1ad9 Re-enable -Wunused-variable for clang. " restores checking for unused variables, which revealed an unused variables in the code.
The unused variable has been removed.

Commit : 78b1ad9 Re-enable -Wunused-variable for clang.
Change restores checking for unused variables,
which revealed an unused round_s variable in the code.
The unused variable has been removed.

Signed-off-by: Mateusz Junkier <[email protected]>
Commit : 78b1ad9 Re-enable -Wunused-variable for clang.
Change restores checking for unused variables,
which revealed an unused syst_headers_name variable in the code.
The unused variable has been removed.

Signed-off-by: Mateusz Junkier <[email protected]>
@@ -287,8 +281,8 @@ static void test_conversion(struct test_rec *t, uint64_t val)
zassert_true(diff <= maxdiff && diff >= mindiff,
"Convert %llu (%llx) from %u Hz to %u Hz %u-bit %s\n"
"result %llu (%llx) diff %lld (%llx) should be in [%lld:%lld]",
val, val, from_hz, to_hz, t->precision, round_s[t->round],
result, result, diff, diff, mindiff, maxdiff);
val, val, from_hz, to_hz, t->precision, t->round, result, result, diff, diff,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear to me why round_s would be showing up as unused. However, if it is removed, then the format string above would have to be updated as t->round is an integer, not a string.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just opened #89482 to add validation of strings used in zasserts. Maybe that will fix unused variables case as well as it seems that for some reason formatted string used for zassert is not evaluated when unused variable warning is raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants