Skip to content

test: cleanup assertion macros

Stephen Hemminger dpdk-dev 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2test: use inline helpers in buffer comparison macrosapp/test/test.h+93 -530 replies
2/2test: parenthesize assertion macro parameters.mailmap lib/eal/include/rte_test.h+7 -60 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMarat KhaliliStephen Hemminger
1/2A-b A-b
2/2A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] test: cleanup assertion macros

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(-)
Signature · 1 line
2.53.0