mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 08:10:26 +01:00
test: drop the litest feature enum, make it normal bits instead
The coverity compiler can't handle 64-bit enums and since it does provide useful data, let's switch this to #defines instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cc370f53c4
commit
6f6a9d95d5
3 changed files with 46 additions and 52 deletions
|
|
@ -35,7 +35,7 @@ struct litest_test_device {
|
|||
struct list node; /* global test device list */
|
||||
|
||||
enum litest_device_type type;
|
||||
enum litest_device_feature features;
|
||||
int64_t features;
|
||||
const char *shortname;
|
||||
void (*setup)(void); /* test fixture, used by check */
|
||||
void (*teardown)(void); /* test fixture, used by check */
|
||||
|
|
|
|||
|
|
@ -400,8 +400,8 @@ static void
|
|||
litest_add_tcase(const char *suite_name,
|
||||
const char *funcname,
|
||||
void *func,
|
||||
enum litest_device_feature required,
|
||||
enum litest_device_feature excluded,
|
||||
int64_t required,
|
||||
int64_t excluded,
|
||||
const struct range *range)
|
||||
{
|
||||
struct suite *suite;
|
||||
|
|
@ -515,8 +515,8 @@ void
|
|||
_litest_add(const char *name,
|
||||
const char *funcname,
|
||||
void *func,
|
||||
enum litest_device_feature required,
|
||||
enum litest_device_feature excluded)
|
||||
int64_t required,
|
||||
int64_t excluded)
|
||||
{
|
||||
_litest_add_ranged(name,
|
||||
funcname,
|
||||
|
|
@ -530,8 +530,8 @@ void
|
|||
_litest_add_ranged(const char *name,
|
||||
const char *funcname,
|
||||
void *func,
|
||||
enum litest_device_feature required,
|
||||
enum litest_device_feature excluded,
|
||||
int64_t required,
|
||||
int64_t excluded,
|
||||
const struct range *range)
|
||||
{
|
||||
litest_add_tcase(name, funcname, func, required, excluded, range);
|
||||
|
|
|
|||
|
|
@ -302,47 +302,41 @@ enum litest_device_type {
|
|||
LITEST_WACOM_ISDV4_4200_PEN,
|
||||
};
|
||||
|
||||
enum litest_device_feature {
|
||||
LITEST_DEVICELESS = -2,
|
||||
LITEST_DISABLE_DEVICE = -1,
|
||||
LITEST_ANY = 0,
|
||||
LITEST_TOUCHPAD = bit(0),
|
||||
LITEST_CLICKPAD = bit(1),
|
||||
LITEST_BUTTON = bit(2),
|
||||
LITEST_KEYS = bit(3),
|
||||
LITEST_RELATIVE = bit(4),
|
||||
LITEST_WHEEL = bit(5),
|
||||
LITEST_TOUCH = bit(6),
|
||||
LITEST_SINGLE_TOUCH = bit(7),
|
||||
LITEST_APPLE_CLICKPAD = bit(8),
|
||||
LITEST_TOPBUTTONPAD = bit(9),
|
||||
LITEST_SEMI_MT = bit(10),
|
||||
LITEST_POINTINGSTICK = bit(11),
|
||||
LITEST_FAKE_MT = bit(12),
|
||||
LITEST_ABSOLUTE = bit(13),
|
||||
LITEST_PROTOCOL_A = bit(14),
|
||||
LITEST_HOVER = bit(15),
|
||||
LITEST_ELLIPSE = bit(16),
|
||||
LITEST_TABLET = bit(17),
|
||||
LITEST_DISTANCE = bit(18),
|
||||
LITEST_TOOL_SERIAL = bit(19),
|
||||
LITEST_TILT = bit(20),
|
||||
LITEST_TABLET_PAD = bit(21),
|
||||
LITEST_RING = bit(22),
|
||||
LITEST_STRIP = bit(23),
|
||||
LITEST_TRACKBALL = bit(24),
|
||||
LITEST_LEDS = bit(25),
|
||||
LITEST_SWITCH = bit(26),
|
||||
LITEST_IGNORED = bit(27),
|
||||
LITEST_NO_DEBOUNCE = bit(28),
|
||||
LITEST_TOOL_MOUSE = bit(29),
|
||||
LITEST_DIRECT = bit(30),
|
||||
LITEST_TOTEM = bit(31),
|
||||
|
||||
_LITEST_DEVICE_FEATURE__FORCE_SIZE = LONG_MAX,
|
||||
};
|
||||
|
||||
static_assert(sizeof(enum litest_device_feature) >= 8, "enum size expected to be 8");
|
||||
#define LITEST_DEVICELESS -2
|
||||
#define LITEST_DISABLE_DEVICE -1
|
||||
#define LITEST_ANY 0
|
||||
#define LITEST_TOUCHPAD bit(0)
|
||||
#define LITEST_CLICKPAD bit(1)
|
||||
#define LITEST_BUTTON bit(2)
|
||||
#define LITEST_KEYS bit(3)
|
||||
#define LITEST_RELATIVE bit(4)
|
||||
#define LITEST_WHEEL bit(5)
|
||||
#define LITEST_TOUCH bit(6)
|
||||
#define LITEST_SINGLE_TOUCH bit(7)
|
||||
#define LITEST_APPLE_CLICKPAD bit(8)
|
||||
#define LITEST_TOPBUTTONPAD bit(9)
|
||||
#define LITEST_SEMI_MT bit(10)
|
||||
#define LITEST_POINTINGSTICK bit(11)
|
||||
#define LITEST_FAKE_MT bit(12)
|
||||
#define LITEST_ABSOLUTE bit(13)
|
||||
#define LITEST_PROTOCOL_A bit(14)
|
||||
#define LITEST_HOVER bit(15)
|
||||
#define LITEST_ELLIPSE bit(16)
|
||||
#define LITEST_TABLET bit(17)
|
||||
#define LITEST_DISTANCE bit(18)
|
||||
#define LITEST_TOOL_SERIAL bit(19)
|
||||
#define LITEST_TILT bit(20)
|
||||
#define LITEST_TABLET_PAD bit(21)
|
||||
#define LITEST_RING bit(22)
|
||||
#define LITEST_STRIP bit(23)
|
||||
#define LITEST_TRACKBALL bit(24)
|
||||
#define LITEST_LEDS bit(25)
|
||||
#define LITEST_SWITCH bit(26)
|
||||
#define LITEST_IGNORED bit(27)
|
||||
#define LITEST_NO_DEBOUNCE bit(28)
|
||||
#define LITEST_TOOL_MOUSE bit(29)
|
||||
#define LITEST_DIRECT bit(30)
|
||||
#define LITEST_TOTEM bit(31)
|
||||
|
||||
/* this is a semi-mt device, so we keep track of the touches that the tests
|
||||
* send and modify them so that the first touch is always slot 0 and sends
|
||||
|
|
@ -444,14 +438,14 @@ void
|
|||
_litest_add(const char *name,
|
||||
const char *funcname,
|
||||
void *func,
|
||||
enum litest_device_feature required_feature,
|
||||
enum litest_device_feature excluded_feature);
|
||||
int64_t required_feature,
|
||||
int64_t excluded_feature);
|
||||
void
|
||||
_litest_add_ranged(const char *name,
|
||||
const char *funcname,
|
||||
void *func,
|
||||
enum litest_device_feature required,
|
||||
enum litest_device_feature excluded,
|
||||
int64_t required,
|
||||
int64_t excluded,
|
||||
const struct range *range);
|
||||
void
|
||||
_litest_add_for_device(const char *name,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue