未验证 提交 ac3cde30 编写于 作者: R Roland Stahn 提交者: GitHub

Added notes on _MESSAGE assertions (#331)

Added notes, why _MESSAGE assertions do not support printf style formatting and how users can work around this limitation (see #331)
上级 1f6c7820
......@@ -104,6 +104,15 @@ becomes messageified like thus...
TEST_ASSERT_X_MESSAGE( {modifiers}, {expected}, actual, {size/count}, message )
Notes:
- The `_MESSAGE` variants intentionally do not support `printf` style formatting
since many embedded projects don't support or avoid `printf` for various reasons.
It is possible to use `sprintf` before the assertion to assemble a complex fail
message, if necessary.
- If you want to output a counter value within an assertion fail message (e.g. from
a loop) , building up an array of results and then using one of the `_ARRAY`
assertions (see below) might be a handy alternative to `sprintf`.
#### TEST_ASSERT_X_ARRAY Variants
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册