summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-06-10 06:11:10 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2010-06-11 09:30:07 +1000
commit645679c1523eee7028f3244cee57936b93326a2a (patch)
tree60f11e77c5ba92189012f7f7aba814cf042c1012 /test
parentd1b4beecbc16448282dcc825dd5c354e96e48eca (diff)
xfree86: Match devices based on PnP ID
Serial input devices lack properties such as product or vendor name. This makes matching InputClass sections difficult. Add a MatchPnPID entry to test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME flag in fnmatch(3). Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/input.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/input.c b/test/input.c
index 12771c59a..dd197dd64 100644
--- a/test/input.c
+++ b/test/input.c
@@ -801,6 +801,13 @@ static void cmp_attr_fields(InputAttributes *attr1,
} else
g_assert(attr2->device == NULL);
+ if (attr1->pnp_id != NULL)
+ {
+ g_assert(attr1->pnp_id != attr2->pnp_id);
+ g_assert(strcmp(attr1->pnp_id, attr2->pnp_id) == 0);
+ } else
+ g_assert(attr2->pnp_id == NULL);
+
tags1 = attr1->tags;
tags2 = attr2->tags;
@@ -866,6 +873,11 @@ static void dix_input_attributes(void)
cmp_attr_fields(&orig, new);
FreeInputAttributes(new);
+ orig.pnp_id = "PnPID";
+ new = DuplicateInputAttributes(&orig);
+ cmp_attr_fields(&orig, new);
+ FreeInputAttributes(new);
+
orig.flags = 0xF0;
new = DuplicateInputAttributes(&orig);
cmp_attr_fields(&orig, new);