mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 18:30:07 +01:00
test: define a common device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
4ac78fd6df
commit
20f7cb8006
4 changed files with 15 additions and 13 deletions
|
|
@ -38,7 +38,7 @@ int test_create_device(struct uinput_device **uidev_return,
|
|||
|
||||
va_start(args, dev_return);
|
||||
|
||||
rc = uinput_device_new_with_events_v(&uidev, "test device", DEFAULT_IDS, args);
|
||||
rc = uinput_device_new_with_events_v(&uidev, TEST_DEVICE_NAME, DEFAULT_IDS, args);
|
||||
va_end(args);
|
||||
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
|
@ -67,7 +67,7 @@ int test_create_abs_device(struct uinput_device **uidev_return,
|
|||
struct libevdev *dev;
|
||||
va_list args;
|
||||
|
||||
uidev = uinput_device_new("test device");
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
va_start(args, abs);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#ifndef _TEST_COMMON_H_
|
||||
#define _TEST_COMMON_H_
|
||||
|
||||
#define TEST_DEVICE_NAME "libevdev test device"
|
||||
|
||||
#include "test-common-uinput.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ START_TEST(test_ev_rep)
|
|||
|
||||
/* EV_REP is special, it's always fully set if set at all,
|
||||
can't test this through uinput though */
|
||||
rc = uinput_device_new_with_events(&uidev, "test device", DEFAULT_IDS,
|
||||
rc = uinput_device_new_with_events(&uidev, TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_REP, 0,
|
||||
-1);
|
||||
ck_assert_int_eq(rc, -EINVAL);
|
||||
|
|
@ -239,7 +239,7 @@ START_TEST(test_slot_init_value)
|
|||
int i;
|
||||
int fd;
|
||||
|
||||
uidev = uinput_device_new("test device");
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
rc = uinput_device_set_event_bits(uidev,
|
||||
EV_ABS, ABS_X,
|
||||
EV_ABS, ABS_Y,
|
||||
|
|
@ -381,7 +381,7 @@ START_TEST(test_device_name)
|
|||
ck_assert(str != NULL);
|
||||
ck_assert_int_eq(strlen(str), 0);
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev, "test device", &ids,
|
||||
rc = uinput_device_new_with_events(&uidev, TEST_DEVICE_NAME, &ids,
|
||||
EV_ABS, ABS_X,
|
||||
-1);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
|
@ -389,7 +389,7 @@ START_TEST(test_device_name)
|
|||
ck_assert_msg(rc == 0, "Failed to init device: %s", strerror(-rc));;
|
||||
|
||||
str = libevdev_get_name(dev);
|
||||
ck_assert_int_eq(strcmp(str, "test device"), 0);
|
||||
ck_assert_int_eq(strcmp(str, TEST_DEVICE_NAME), 0);
|
||||
|
||||
str = libevdev_get_phys(dev);
|
||||
ck_assert(str == NULL);
|
||||
|
|
@ -416,7 +416,7 @@ START_TEST(test_device_get_abs_info)
|
|||
const struct input_absinfo *a;
|
||||
int rc;
|
||||
|
||||
uidev = uinput_device_new("test device");
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
|
||||
|
|
@ -631,7 +631,7 @@ START_TEST(test_device_disable_bit_invalid)
|
|||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev, "test device", DEFAULT_IDS,
|
||||
rc = uinput_device_new_with_events(&uidev, TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_ABS, ABS_X,
|
||||
-1);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
|
@ -656,7 +656,7 @@ START_TEST(test_device_kernel_change_axis)
|
|||
struct input_absinfo abs;
|
||||
int rc;
|
||||
|
||||
uidev = uinput_device_new("test device");
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
abs.minimum = 0;
|
||||
|
|
@ -716,7 +716,7 @@ START_TEST(test_device_kernel_change_axis_invalid)
|
|||
struct input_absinfo abs;
|
||||
int rc;
|
||||
|
||||
uidev = uinput_device_new("test device");
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
abs.minimum = 0;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ START_TEST(test_init_and_change_fd)
|
|||
ck_assert_int_eq(libevdev_change_fd(dev, -1), -1);
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
"test device", DEFAULT_IDS,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
|
|
@ -124,7 +124,7 @@ START_TEST(test_device_init)
|
|||
int rc;
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
"test device", DEFAULT_IDS,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
|
|
@ -152,7 +152,7 @@ START_TEST(test_device_init_from_fd)
|
|||
int rc;
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
"test device", DEFAULT_IDS,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue