[PATCH 3/4] Fix tests

Martin Minarik minarik11 at student.fiit.stuba.sk
Fri Sep 6 22:52:48 PDT 2013


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);
 	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
+
 #include "test-common.h"
 #define UINPUT_NODE "/dev/uinput"
 
-- 
1.7.10.4



More information about the Input-tools mailing list