summaryrefslogtreecommitdiff
path: root/test/test-switch.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-04-21 17:27:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-09-05 10:41:27 +1000
commite0558033214eff2c6e6cbc58c63031c25d2fe7eb (patch)
tree34910c0a5f9b4ac4e95275d5d4b512bedce2f4d4 /test/test-switch.c
parent300416372581f677c865fa5a725d08de32713348 (diff)
test: rename 'sw' to 'dev' for the lid tests
More in line with other tests and allows us to use 'sw' as name for the actual switch to be toggled later. The variable name 'sw' stays in those tests where we have touchpad/keyboard/etc. devices as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-switch.c')
-rw-r--r--test/test-switch.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/test-switch.c b/test/test-switch.c
index 4623e55b..108b3a85 100644
--- a/test/test-switch.c
+++ b/test/test-switch.c
@@ -31,14 +31,14 @@
START_TEST(lid_switch)
{
- struct litest_device *sw = litest_current_device();
- struct libinput *li = sw->libinput;
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
struct libinput_event *event;
litest_drain_events(li);
/* lid closed */
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_ON);
libinput_dispatch(li);
@@ -50,7 +50,7 @@ START_TEST(lid_switch)
libinput_event_destroy(event);
/* lid opened */
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_OFF);
libinput_dispatch(li);
@@ -67,13 +67,13 @@ END_TEST
START_TEST(lid_switch_double)
{
- struct litest_device *sw = litest_current_device();
- struct libinput *li = sw->libinput;
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
struct libinput_event *event;
litest_drain_events(li);
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_ON);
libinput_dispatch(li);
@@ -86,7 +86,7 @@ START_TEST(lid_switch_double)
/* This will be filtered by the kernel, so this test is a bit
* useless */
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_ON);
libinput_dispatch(li);
@@ -114,21 +114,21 @@ lid_switch_is_reliable(struct litest_device *dev)
START_TEST(lid_switch_down_on_init)
{
- struct litest_device *sw = litest_current_device();
+ struct litest_device *dev = litest_current_device();
struct libinput *li;
struct libinput_event *event;
- if (!lid_switch_is_reliable(sw))
+ if (!lid_switch_is_reliable(dev))
return;
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_ON);
/* need separate context to test */
li = litest_create_context();
libinput_path_add_device(li,
- libevdev_uinput_get_devnode(sw->uinput));
+ libevdev_uinput_get_devnode(dev->uinput));
libinput_dispatch(li);
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_SWITCH_TOGGLE, -1);
@@ -144,7 +144,7 @@ START_TEST(lid_switch_down_on_init)
libinput_event_destroy(event);
}
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_OFF);
libinput_dispatch(li);
@@ -162,21 +162,21 @@ END_TEST
START_TEST(lid_switch_not_down_on_init)
{
- struct litest_device *sw = litest_current_device();
+ struct litest_device *dev = litest_current_device();
struct libinput *li;
struct libinput_event *event;
- if (lid_switch_is_reliable(sw))
+ if (lid_switch_is_reliable(dev))
return;
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_ON);
/* need separate context to test */
li = litest_create_context();
libinput_path_add_device(li,
- libevdev_uinput_get_devnode(sw->uinput));
+ libevdev_uinput_get_devnode(dev->uinput));
libinput_dispatch(li);
while ((event = libinput_get_event(li)) != NULL) {
@@ -185,7 +185,7 @@ START_TEST(lid_switch_not_down_on_init)
libinput_event_destroy(event);
}
- litest_switch_action(sw,
+ litest_switch_action(dev,
LIBINPUT_SWITCH_LID,
LIBINPUT_SWITCH_STATE_OFF);
litest_assert_empty_queue(li);