]> granicus.if.org Git - strace/commitdiff
tests/tests.h: add XLAT_STR macro
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 19 Jul 2019 11:08:40 +0000 (13:08 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 24 Sep 2019 15:31:28 +0000 (15:31 +0000)
XLAT_STR allows describing expected output succintly in some simple
cases.

* tests/tests.h (XLAT_STR): New macro.

tests/tests.h

index da6423a85ad64fe0b5756703e63bae3d2adf2e28..53d7b72fd1b28cf827996f358ca170dd9bd9c09a 100644 (file)
@@ -63,6 +63,8 @@
 #  define XLAT_UNKNOWN(val_, dflt_) STRINGIFY_VAL(val_) " /* " dflt_ " */"
 # endif
 
+# define XLAT_STR(v_) sprintxlat(#v_, v_, NULL)
+
 # ifndef DEFAULT_STRLEN
 /* Default maximum # of bytes printed in printstr et al. */
 #  define DEFAULT_STRLEN 32