From aa95ec7648ef9cc58ac7b69a22909063eb455b18 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 24 Sep 2016 23:58:51 +0000 Subject: [PATCH] tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests * tests/ioctl_evdev-v.c (VERBOSE_IOCTL): Remove. (VERBOSE): Define to 1. * tests/ioctl_evdev.c: Check VERBOSE instead of VERBOSE_IOCTL. --- tests/ioctl_evdev-v.c | 2 +- tests/ioctl_evdev.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/ioctl_evdev-v.c b/tests/ioctl_evdev-v.c index 6f1adcfe..3860716b 100644 --- a/tests/ioctl_evdev-v.c +++ b/tests/ioctl_evdev-v.c @@ -1,3 +1,3 @@ /* This file is part of ioctl_evdev-v strace test. */ -#define VERBOSE_IOCTL +#define VERBOSE 1 #include "ioctl_evdev.c" diff --git a/tests/ioctl_evdev.c b/tests/ioctl_evdev.c index 5040b1c1..892075dc 100644 --- a/tests/ioctl_evdev.c +++ b/tests/ioctl_evdev.c @@ -51,7 +51,7 @@ init_magic(void *addr, const unsigned int size) *(unsigned int *) p = magic; } -# ifdef VERBOSE_IOCTL +# if VERBOSE static void print_envelope(const struct ff_envelope *const e) { @@ -60,7 +60,7 @@ print_envelope(const struct ff_envelope *const e) e->attack_length, e->attack_level, e->fade_length, e->fade_level); } -# endif /* VERBOSE_IOCTL */ +# endif /* VERBOSE */ static void print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) @@ -68,12 +68,12 @@ print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) printf("ioctl(-1, EVIOCSFF, {type=%s, id=%" PRIu16 ", direction=%" PRIu16 ", ", type_str, ffe->id, ffe->direction); -# ifdef VERBOSE_IOCTL +# if VERBOSE printf("trigger={button=%hu, interval=%hu}" ", replay={length=%hu, delay=%hu}", ffe->trigger.button, ffe->trigger.interval, ffe->replay.length, ffe->replay.delay); -# endif /* VERBOSE_IOCTL */ +# endif /* VERBOSE */ } # define TEST_NULL_ARG(cmd) \ @@ -189,7 +189,7 @@ main(void) ioctl(-1, EVIOCSKEYCODE_V2, ike); printf("ioctl(-1, EVIOCSKEYCODE_V2, {flags=%" PRIu8 ", len=%" PRIu8 ", ", ike->flags, ike->len); -# ifdef VERBOSE_IOCTL +# if VERBOSE printf("index=%" PRIu16 ", keycode=%s, scancode=[", ike->index, "KEY_1"); unsigned int i; @@ -213,7 +213,7 @@ main(void) ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_CONSTANT"); -# ifdef VERBOSE_IOCTL +# if VERBOSE printf(", constant={level=%hd", ffe->u.constant.level); print_envelope(&ffe->u.constant.envelope); printf("}"); @@ -223,7 +223,7 @@ main(void) errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# ifdef VERBOSE_IOCTL +# if VERBOSE ffe->type = FF_RAMP; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_RAMP"); -- 2.40.0