[PATCH 0/2] test: clean up assertion macros

Stephen Hemminger stephen at networkplumber.org
Wed Apr 29 16:42:27 CEST 2026


Two patches addressing Bugzilla 1925, which reported missing
parentheses around macro parameters in the DPDK test assertion
macros.

The TEST_ASSERT_BUFFERS_ARE_EQUAL family in app/test/test.h turned
out to have additional issues beyond missing parens -- multiple
evaluation of arguments, no type checking, and a dropped
__VA_ARGS__ in the _OFFSET wrappers -- so patch 1 moves the
comparison logic into static inline helpers.  The macros are now
thin wrappers around the printf / TEST_TRACE_FAILURE / return
TEST_FAILED boilerplate.  Existing call sites need no changes.

Patch 2 is Weijun Pan's original rte_test.h paren fix carried
through unchanged.

Stephen Hemminger (1):
  test: use inline helpers in buffer comparison macros

Weijun Pan (1):
  test: parenthesize assertion macro parameters

 .mailmap                   |   1 +
 app/test/test.h            | 147 ++++++++++++++++++++++++-------------
 lib/eal/include/rte_test.h |  12 +--
 3 files changed, 102 insertions(+), 58 deletions(-)

-- 
2.53.0



More information about the dev mailing list