[PATCH] libsframe: testsuite: make test names unique

Jens Remus jremus@linux.ibm.com
Mon Sep 22 10:01:36 GMT 2025


Hello Indu!

On 9/20/2025 9:33 AM, Indu Bhagat via Binutils wrote:
> I am considering this patch for fixing the PR.

> Fix PR libsframe/33437 - libsframe test names are not unique
> 
> The TEST () macro definition originally in plt-findfre-2.c allows for
> three arguments, the last of which is a suffix char that can be used to
> differentiate between multiple runs of the testcases.  Move that
> definition in the testsuite's common header - sframe-test.h, and use it
> throughout the testsuite.

Nit: The TEST macro allows for a variable number of arguments following
the (1) test condition and (2) test name format string, that are
formatted and inserted into the test name.

Maybe the following definition of TEST would make that more clear?

#define TEST(cond, name_fmt, ...)					\
  do									\
    {                                                                   \
      if (cond)								\
        pass (name_fmt, ## __VA_ARGS__);				\
      else								\
        fail (name_fmt, ## __VA_ARGS__);				\
    }									\
    while (0)

Not sure how portable the use of ", ## __VA_ARGS__" is though.

Otherwise looks good to me.

> libsframe/testsuite/
> 	PR libsframe/33437
> 	* libsframe.decode/be-flipping.c: Use new TEST macro with
> 	suffix.
> 	* libsframe.decode/frecnt-1.c: Likewise.
> 	* libsframe.decode/frecnt-2.c: Likewise.
> 	* libsframe.encode/encode-1.c: Likewise.
> 	* libsframe.find/findfre-1.c: Likewise.
> 	* libsframe.find/findfunc-1.c: Likewise.
> 	* libsframe.find/plt-findfre-1.c: Likewise.
> 	* libsframe.find/plt-findfre-2.c: Likewise.
> 	* sframe-test.h: Move the TEST macro definition to this
> 	testsuite header.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com

IBM

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list