[PATCH v2 0/2] test: cleanup assertion macros
Stephen Hemminger
stephen at networkplumber.org
Fri May 1 18:34:44 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.
v2 - incorporate review feedback
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 | 146 +++++++++++++++++++++++--------------
lib/eal/include/rte_test.h | 12 +--
3 files changed, 100 insertions(+), 59 deletions(-)
--
2.53.0
More information about the dev
mailing list