[PATCH] test: parenthesize common macro arguments

Stephen Hemminger stephen at networkplumber.org
Sat Mar 28 22:51:49 CET 2026


On Thu, 26 Mar 2026 17:47:49 +0000
Marat Khalili <marat.khalili at huawei.com> wrote:

> Parenthesize argument substitutions in macros commonly used by tests.
> 
> Without parentheses around arguments macros like TEST_ASSERT_SUCCESS
> could produce incorrect results if passed e.g. a ternary expression.
> 
> Signed-off-by: Marat Khalili <marat.khalili at huawei.com>
> ---
> Very curious how none of the code-checking tools we have like Coverity
> flagged this trivial issue.
> 
> To highlight non-whitespace changes: git show --word-diff --anchored='/*'

The bigger parts should be converted to functions.
This is test infrastructure no need for multi-line macros.


More information about the dev mailing list