summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-06-10 06:15:41 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2010-06-11 09:30:33 +1000
commit87a1507da7e7788232d74285ef377b67b70e0fa4 (patch)
tree5fe21b2ea4299acfad7603259abfd7330781abee /test
parent645679c1523eee7028f3244cee57936b93326a2a (diff)
xfree86: Match devices based on USB ID
Sometimes the vendor and product names aren't specific enough to target a USB device, so expose the numeric codes in the ID. A MatchUSBID entry has been added that supports shell pattern matching when fnmatch(3) is available. For example: MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". 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 dd197dd64..b90d3b4fd 100644
--- a/test/input.c
+++ b/test/input.c
@@ -808,6 +808,13 @@ static void cmp_attr_fields(InputAttributes *attr1,
} else
g_assert(attr2->pnp_id == NULL);
+ if (attr1->usb_id != NULL)
+ {
+ g_assert(attr1->usb_id != attr2->usb_id);
+ g_assert(strcmp(attr1->usb_id, attr2->usb_id) == 0);
+ } else
+ g_assert(attr2->usb_id == NULL);
+
tags1 = attr1->tags;
tags2 = attr2->tags;
@@ -878,6 +885,11 @@ static void dix_input_attributes(void)
cmp_attr_fields(&orig, new);
FreeInputAttributes(new);
+ orig.usb_id = "USBID";
+ new = DuplicateInputAttributes(&orig);
+ cmp_attr_fields(&orig, new);
+ FreeInputAttributes(new);
+
orig.flags = 0xF0;
new = DuplicateInputAttributes(&orig);
cmp_attr_fields(&orig, new);