diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-11-26 09:55:30 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-12-20 15:01:56 +1000 |
commit | bff714f45b48b551c0662658578c5e4080738670 (patch) | |
tree | fd615dc447abf9aaf0549141b85a53e6fa68cf3f /test | |
parent | 6e10faec5fcd09bd1390a0d59f436f14e5555e77 (diff) | |
download | xf86-input-wacom-bff714f45b48b551c0662658578c5e4080738670.tar.gz |
Switch the type handling to an enum
The init code remains largely as-is but as soon as sensible, change this
to an enum value and keep it in the device. The X driver layer can
convert that into the type_name as required.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/wacom-tests.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/test/wacom-tests.c b/test/wacom-tests.c index 2cb291a..7a1aad5 100644 --- a/test/wacom-tests.c +++ b/test/wacom-tests.c @@ -541,11 +541,7 @@ static void test_set_type(void) reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, NULL); - assert(rc == 0); - - reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "stylus"); + rc = wcmSetFlags(&priv, WTYPE_STYLUS); assert(rc == 1); assert(is_absolute(&priv)); assert(IsStylus(&priv)); @@ -555,7 +551,7 @@ static void test_set_type(void) assert(!IsPad(&priv)); reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "touch"); + rc = wcmSetFlags(&priv, WTYPE_TOUCH); assert(rc == 1); /* only some touch screens are absolute */ assert(!is_absolute(&priv)); @@ -566,7 +562,7 @@ static void test_set_type(void) assert(!IsPad(&priv)); reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "eraser"); + rc = wcmSetFlags(&priv, WTYPE_ERASER); assert(rc == 1); assert(is_absolute(&priv)); assert(!IsStylus(&priv)); @@ -576,7 +572,7 @@ static void test_set_type(void) assert(!IsPad(&priv)); reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "cursor"); + rc = wcmSetFlags(&priv, WTYPE_CURSOR); assert(rc == 1); assert(!is_absolute(&priv)); assert(!IsStylus(&priv)); @@ -586,7 +582,7 @@ static void test_set_type(void) assert(!IsPad(&priv)); reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "pad"); + rc = wcmSetFlags(&priv, WTYPE_PAD); assert(rc == 1); assert(is_absolute(&priv)); assert(!IsStylus(&priv)); @@ -596,7 +592,7 @@ static void test_set_type(void) assert(IsPad(&priv)); reset(info, priv, tool, common); - rc = wcmSetFlags(&priv, "foobar"); + rc = wcmSetFlags(&priv, WTYPE_INVALID); assert(rc == 0); #undef reset |