tests: move ARG_STR and similar macros to tests.h

* tests/add_key.c (_STR, ARG_STR): Move ...
* tests/tests.h: ... here.
(ARG_ULL_STR): New macro.
* tests/keyctl.c (ARG_STR): Remove.
* tests/quotactl.h (ARG_STR): Likewise.
* tests/request_key.c (ARG_STR): Likewise.
This commit is contained in:
Eugene Syromyatnikov
2016-10-13 10:26:07 +03:00
parent f0fb4e9de4
commit d212c95b84
5 changed files with 4 additions and 10 deletions

View File

@ -65,9 +65,6 @@ do_add_key(const char *type, const char *type_str, const char *desc,
printf(") = %s\n", errstr);
}
# define _STR(_arg) #_arg
# define ARG_STR(_arg) (_arg), #_arg
int
main(void)
{

View File

@ -190,8 +190,6 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...)
printf(") = %s\n", errstr);
}
# define ARG_STR(_arg) (_arg), #_arg
int
main(void)
{

View File

@ -69,8 +69,6 @@
printf("%s%s=%#llx", (prefix), #field, \
zero_extend_signed_to_ull((where)->field))
# define ARG_STR(_arg) (_arg), #_arg
typedef void (*print_cb)(long rc, void *addr, void *arg);
enum check_quotactl_flag_bits {

View File

@ -64,9 +64,6 @@ do_request_key(const char *type, const char *type_str, const char *desc,
printf(") = %s\n", errstr);
}
# define _STR(_arg) #_arg
# define ARG_STR(_arg) (_arg), #_arg
int
main(void)
{

View File

@ -186,4 +186,8 @@ int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int);
# 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
#endif /* !STRACE_TESTS_H */