[PATCH 3/4] Fix tests

David Herrmann dh.herrmann at gmail.com
Tue Sep 10 04:08:44 PDT 2013


Hi

On Sat, Sep 7, 2013 at 7:52 AM, Martin Minarik
<minarik11 at student.fiit.stuba.sk> wrote:
> This fixes some weird issues from the tests.
>
> Signed-off-by: Martin Minarik <minarik11 at student.fiit.stuba.sk>
>
> ---
>  test/test-libevdev-init.c |    5 ++++-
>  test/test-uinput.c        |    4 ++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/test/test-libevdev-init.c b/test/test-libevdev-init.c
> index 02dfa8b..0bf30ea 100644
> --- a/test/test-libevdev-init.c
> +++ b/test/test-libevdev-init.c
> @@ -80,7 +80,10 @@ START_TEST(test_init_and_change_fd)
>                                            EV_KEY, BTN_RIGHT,
>                                            -1);
>         ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
> -       ck_assert_int_eq(libevdev_set_fd(dev, uinput_device_get_fd(uidev)), 0);
> +
> +       int done = libevdev_set_fd(dev, uinput_device_get_fd(uidev));
> +
> +       ck_assert_int_eq(done, 0);

There is no obvious functional change here. Could you explain why this
is needed? Does ck_assert_*() do multiple argument evaluations?

>         ck_assert_int_eq(libevdev_set_fd(dev, 0), -EBADF);
>
>         ck_assert_int_eq(libevdev_get_fd(dev), uinput_device_get_fd(uidev));
> diff --git a/test/test-uinput.c b/test/test-uinput.c
> index 2e9d3cd..0bbc7c8 100644
> --- a/test/test-uinput.c
> +++ b/test/test-uinput.c
> @@ -28,6 +28,10 @@
>  #include <fcntl.h>
>  #include <libevdev/libevdev-uinput.h>
>
> +#ifndef ck_assert_int_gt
> +#define ck_assert_int_gt(X, Y) _ck_assert_int(X, >, Y)
> +#endif
> +

That's not how we fix missing declarations. If we depend on a given
version of "check", we need to define this in configure.ac. If this
macro isn't available in an older version but you want "make check"
support, then don't use the macro. We shouldn't paper over it.

Thanks
David

>  #include "test-common.h"
>  #define UINPUT_NODE "/dev/uinput"
>
> --
> 1.7.10.4
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list