]> granicus.if.org Git - strace/commitdiff
tests: use STRINGIFY instead of _STR
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jun 2018 10:10:43 +0000 (10:10 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jun 2018 10:10:43 +0000 (10:10 +0000)
Remove _STR which is essentially the same as STRINGIFY but from
the namespace where we should not introduce new identifiers.

* tests/tests.h (_STR): Remove.
* tests/add_key.c (main): Replace _STR with STRINGIFY.
* tests/keyctl.c (XARG_STR): Likewise.
* tests/request_key.c (main): Likewise.

tests/add_key.c
tests/keyctl.c
tests/request_key.c
tests/tests.h

index 999da0350dab91553ab9abf02a5335f1f796a275..a665d6622982ff1c91fd024c551938c280d42595 100644 (file)
@@ -102,7 +102,7 @@ main(void)
                { bogus_desc, NULL },
                { ARG_STR("\25\26\27\30\31") },
                { ARG_STR("desc") },
-               { "overly long description", _STR("overly long ") "..." },
+               { "overly long description", STRINGIFY("overly long ") "..." },
        };
 
        struct {
@@ -113,10 +113,10 @@ main(void)
                { ARG_STR(NULL), 0 },
                { bogus_payload + sizeof(unterminated3), NULL,
                        (size_t) 0xdeadbeefbadc0dedULL },
-               { bogus_payload, _STR(""), 0 },
-               { bogus_payload, _STR("\16\17\20\21\22"), 5 },
+               { bogus_payload, STRINGIFY(""), 0 },
+               { bogus_payload, STRINGIFY("\16\17\20\21\22"), 5 },
                { bogus_payload, NULL, 10 },
-               { "overly long payload", _STR("overly long ") "...", 15 },
+               { "overly long payload", STRINGIFY("overly long ") "...", 15 },
        };
 
        struct {
index 2183266705e93f6f52b72e3ca03e24fa7b1d6e80..881f24b3a3e360acabee7f5f247c561a0063c821 100644 (file)
@@ -90,9 +90,9 @@ bool buf_in_arg;
 # define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345"
 
 #if XLAT_RAW
-# define XARG_STR(v_) (v_), _STR(v_)
+# define XARG_STR(v_) (v_), STRINGIFY(v_)
 #elif XLAT_VERBOSE
-# define XARG_STR(v_) (v_), _STR(v_) " /* " #v_ " */"
+# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */"
 #else
 # define XARG_STR ARG_STR
 #endif
index 866fe76e2627b688fda0ffcc8b7e2b547fb5f1d7..bbeba45391a937f864a58cea511807c572998cf5 100644 (file)
@@ -101,7 +101,7 @@ main(void)
                { bogus_desc, NULL },
                { ARG_STR("\25\26\27\30\31") },
                { ARG_STR("desc") },
-               { "overly long description", _STR("overly long ") "..." },
+               { "overly long description", STRINGIFY("overly long ") "..." },
        };
 
        struct {
@@ -113,7 +113,7 @@ main(void)
                { bogus_info, NULL },
                { ARG_STR("\32\33\34\35\36") },
                { ARG_STR("info") },
-               { "overly long info", _STR("overly long ") "..." },
+               { "overly long info", STRINGIFY("overly long ") "..." },
        };
 
        struct {
index 7c323dc608a39ac197fae2a058d05d16adb65110..9b829ea36dce4f14bf30b9422913140ebfd74e57 100644 (file)
@@ -288,7 +288,6 @@ f8ill_ptr_to_kulong(const void *const ptr)
 #endif
 #define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval))
 
-#define _STR(_arg) #_arg
 #define ARG_STR(_arg) (_arg), #_arg
 #define ARG_ULL_STR(_arg) _arg##ULL, #_arg