diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2019-07-01 16:12:26 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2019-07-08 09:44:12 +1000 |
commit | 6f6a9d95d5d268e50cff5a9aa733881e43e26b87 (patch) | |
tree | d3a5a466c8a0c6d439029f4238cdbe8bd3813199 | |
parent | cc370f53c46c1f79c7f669157a6bf5113aed0e1d (diff) | |
download | libinput-6f6a9d95d5d268e50cff5a9aa733881e43e26b87.tar.gz |
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>
-rw-r--r-- | test/litest-int.h | 2 | ||||
-rw-r--r-- | test/litest.c | 12 | ||||
-rw-r--r-- | test/litest.h | 84 |
3 files changed, 46 insertions, 52 deletions
diff --git a/test/litest-int.h b/test/litest-int.h index c4333159..24d60874 100644 --- a/test/litest-int.h +++ b/test/litest-int.h @@ -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 */ diff --git a/test/litest.c b/test/litest.c index 7c8c83cc..a9ec9a9c 100644 --- a/test/litest.c +++ b/test/litest.c @@ -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); diff --git a/test/litest.h b/test/litest.h index af63877c..98b536ba 100644 --- a/test/litest.h +++ b/test/litest.h @@ -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, |