Skip to content

testing/ostest: stringify wdtest_assert at the first macro level - #4033

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fix-Point:fix-assert-stringify
Nov 13, 2026
Merged

xiaoxiang781216 merged 1 commit into
apache:masterfrom
Fix-Point:fix-assert-stringify

Conversation

@Fix-Point

@Fix-Point Fix-Point commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Depends-On: apache/nuttx#21764

Summary

This PR updates ostest's wdtest_assert() to pass its argument as literal text to _ASSERT(). wdtest_assert(x) forwarded x to _ASSERT(x, __FILE__, __LINE__), whose #f stringified the argument after the wdtest_assert -> _ASSERT chain had already macro-expanded it. Passing #x from wdtest_assert itself keeps the assert message as the literal expression text instead of an expanded macro tree.

This is the apps-side companion to the NuttX change "include/assert: stringify assert expressions at the first macro level", which makes _ASSERT() take the expression string as a 4th parameter.

Impact

  • User: none — wdtest_assert reports the literal assertion text; no behavior change (the condition is evaluated exactly as before).
  • Build: no config or build-system change.
  • Compatibility: matches the NuttX change above (hence Depends-On); the change is one macro definition in ostest.
  • Security: no change.

Testing

  • Covered by the NuttX-side verification of the stringification behavior (qemu-intel64, CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y: assert strings hold the source text, no large strings in the image).
  • The ostest wdog tests exercise wdtest_assert; the change is a macro-level stringification fix with no behavior difference.

jerpelea
jerpelea previously approved these changes Nov 12, 2026
wdtest_assert(x) forwarded x to _ASSERT(x, __FILE__, __LINE__), whose #f
stringified the argument after the wdtest_assert -> _ASSERT chain had
already macro-expanded it.  Pass the stringified argument (#x) from
wdtest_assert itself so the assert message holds the literal expression
text instead of an expanded macro tree.

This matches the NuttX change "include/assert: stringify assert
expressions at the first macro level", which makes _ASSERT() take the
expression string as a 4th parameter.

Assisted-By: mimo-v2.6-pro
Signed-off-by: ouyangxiangzhen <[email protected]>
@Fix-Point
Fix-Point dismissed stale reviews from jerpelea and xiaoxiang781216 via d9c0f13 November 12, 2026 07:55
@Fix-Point
Fix-Point force-pushed the fix-assert-stringify branch from d3783d2 to d9c0f13 Compare November 12, 2026 07:55
@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx-apps/actions/runs/43178902330

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.

3 participants