switch_has_lid(struct litest_device *dev)
{
return libinput_device_switch_has_switch(dev->libinput_device,
- LIBINPUT_SWITCH_LID);
+ LIBINPUT_SWITCH_LID) > 0;
}
static inline bool
switch_has_tablet_mode(struct litest_device *dev)
{
return libinput_device_switch_has_switch(dev->libinput_device,
- LIBINPUT_SWITCH_TABLET_MODE);
+ LIBINPUT_SWITCH_TABLET_MODE) > 0;
}
START_TEST(switch_has_cap)
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_ON);
libinput_dispatch(li);
- if (libinput_device_switch_has_switch(dev->libinput_device, sw)) {
+ if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
event = libinput_get_event(li);
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_ON);
libinput_event_destroy(event);
litest_switch_action(dev, sw, LIBINPUT_SWITCH_STATE_OFF);
libinput_dispatch(li);
- if (libinput_device_switch_has_switch(dev->libinput_device, sw)) {
+ if (libinput_device_switch_has_switch(dev->libinput_device, sw) > 0) {
event = libinput_get_event(li);
litest_is_switch_event(event, sw, LIBINPUT_SWITCH_STATE_OFF);
libinput_event_destroy(event);
struct libinput_event *event;
enum libinput_switch sw = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(dev->libinput_device, sw))
+ if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
return;
litest_drain_events(li);
struct libinput_event *event;
enum libinput_switch sw = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(dev->libinput_device, sw))
+ if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
return;
if (sw == LIBINPUT_SWITCH_LID && !lid_switch_is_reliable(dev))
struct libinput_event *event;
enum libinput_switch sw = LIBINPUT_SWITCH_LID;
- if (!libinput_device_switch_has_switch(dev->libinput_device, sw))
+ if (libinput_device_switch_has_switch(dev->libinput_device, sw) <= 0)
return;
if (sw == LIBINPUT_SWITCH_LID && lid_switch_is_reliable(dev))
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput_event *event;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);
struct libinput *li = sw->libinput;
enum libinput_switch which = _i; /* ranged test */
- if (!libinput_device_switch_has_switch(sw->libinput_device, which))
+ if (libinput_device_switch_has_switch(sw->libinput_device, which) <= 0)
return;
touchpad = switch_init_paired_touchpad(li);