tests: use VERBOSE macro in ioctl_evdev and ioctl_evdev-v tests
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Sep 2016 23:58:51 +0000 (23:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 26 Sep 2016 15:24:01 +0000 (15:24 +0000)
* 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
tests/ioctl_evdev.c

index 6f1adcfe167a8b55fde0644755ddb4891f20a248..3860716b7ee3dc765d8c24ae41fcb07b745148fc 100644 (file)
@@ -1,3 +1,3 @@
 /* This file is part of ioctl_evdev-v strace test. */
-#define VERBOSE_IOCTL
+#define VERBOSE 1
 #include "ioctl_evdev.c"
index 5040b1c1026d6b48df3f64aa0dda4835168c016d..892075dc32126d267053992ba22a55f5b164c3d9 100644 (file)
@@ -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");