test: shut up compiler warning
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 18 Mar 2014 03:58:18 +0000 (13:58 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 18 Mar 2014 23:36:41 +0000 (09:36 +1000)
test-libevdev-events.c: In function ‘test_double_syn_dropped_event’:
test-libevdev-events.c:187:2: warning: ignoring return value of ‘read’,
declared with attribute warn_unused_result [-Wunused-result]

This read was there to drain events even when there shouldn't be any on the
pipe anyway. So let's add an assert.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
test/test-libevdev-events.c

index 56f21a6..de598f9 100644 (file)
@@ -184,7 +184,7 @@ START_TEST(test_double_syn_dropped_event)
        /* sneak in a button change event while we're not looking, this way
         * the sync queue contains 2 events: BTN_LEFT and SYN_REPORT. */
        uinput_device_event(uidev, EV_KEY, BTN_LEFT, 0);
-       read(pipefd[0], &ev, sizeof(ev));
+       ck_assert_int_eq(read(pipefd[0], &ev, sizeof(ev)), -1);
 
        libevdev_change_fd(dev, uinput_device_get_fd(uidev));