Skip to content

testsuite: ztest: Add validation of zassert strings #89482

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

Merged
merged 9 commits into from
May 22, 2025

Conversation

nordic-krch
Copy link
Collaborator

Add noncallable printf with string used for ztest assert/assume macros to ensure printf-like argument validation at compile time.

jeremybettis
jeremybettis previously approved these changes May 5, 2025
@nordic-krch nordic-krch force-pushed the zassert_printf branch 2 times, most recently from 7a484a0 to 359c2a7 Compare May 9, 2025 10:28
@nordic-krch
Copy link
Collaborator Author

@nashif is it possible to ignore SonarCloud false negatives? It is reporting a finding in a test but test will fail before that condition may occur.

@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label May 12, 2025
microbuilder
microbuilder previously approved these changes May 13, 2025
@nordic-krch nordic-krch force-pushed the zassert_printf branch 2 times, most recently from 851a307 to 0a05318 Compare May 20, 2025 14:17
Add noncallable printf with string used for ztest assert/assume
macros to ensure printf-like argument validation at compile time.

Signed-off-by: Krzysztof Chruściński <[email protected]>
After introducing compile time argument validation of strings
used in zassert macros multiple warnings appear. Fix all of
them.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameter used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameters used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameter used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameter used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameter used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Fix wrong parameter used in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Update zscilib with cleanup in zassert macros.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Copy link

@nordic-krch
Copy link
Collaborator Author

@microbuilder can you re-approve? I had to rebase to resolve conflicts.

Copy link
Collaborator

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

FS ok

@kartben kartben merged commit 782d698 into zephyrproject-rtos:main May 22, 2025
26 checks passed
@kartben
Copy link
Collaborator

kartben commented May 22, 2025

@nordic-krch can you please have a look at https://github.com/zephyrproject-rtos/zephyr/actions/runs/15189028448 and follow up with the remainder of fixes that seem needed?

@nordic-krch
Copy link
Collaborator Author

@kartben I've opened #90370.

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.

6 participants