Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
Changes to v1: 
- update for new libwacom_get_matches() API

 test/load.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/test/load.c b/test/load.c
index 96479a0..173b762 100644
--- a/test/load.c
+++ b/test/load.c
@@ -33,6 +33,29 @@
 #include "libwacom.h"
 #include <assert.h>
 
+static void check_multiple_match(WacomDevice *device)
+{
+    const WacomMatch **match;
+    int nmatches = 0;
+    int found_bus = 0,
+       found_vendor_id = 0,
+       found_product_id = 0;
+
+    for (match = libwacom_get_matches(device); *match; match++)
+    {
+           nmatches++;
+           if (libwacom_match_get_bustype(*match) == 
libwacom_get_bustype(device))
+                   found_bus = 1;
+           if (libwacom_match_get_vendor_id(*match) == 
libwacom_get_vendor_id(device))
+                   found_vendor_id = 1;
+           if (libwacom_match_get_product_id(*match) == 
libwacom_get_product_id(device))
+                   found_product_id = 1;
+    }
+
+    assert(nmatches == 2);
+    assert(found_bus && found_vendor_id && found_product_id);
+}
+
 int main(int argc, char **argv)
 {
     WacomDeviceDatabase *db;
@@ -67,6 +90,9 @@ int main(int argc, char **argv)
     assert(libwacom_get_width(device) == 8);
     assert(libwacom_get_height(device) == 5);
 
+    /* I4 WL has two matches */
+    check_multiple_match(device);
+
     libwacom_destroy(device);
 
     device = libwacom_new_from_usbid(db, 0x56a, 0x00b9, NULL);
-- 
1.7.10


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to