On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

Pending API change in patch 3.

Signed-off-by: Bastien Nocera <had...@hadess.net>

> ---
>  test/load.c |   26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/test/load.c b/test/load.c
> index 96479a0..ff4c85f 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)
> +{
> +    WacomMatch **matches;
> +    int nmatches;
> +    int found_bus = 0,
> +     found_vendor_id = 0,
> +     found_product_id = 0;
> +
> +    matches = libwacom_get_matches(device, &nmatches);
> +    assert(nmatches == 2);
> +    while(nmatches--)
> +    {
> +         if (libwacom_match_get_bustype(matches[nmatches]) == 
> libwacom_get_bustype(device))
> +                 found_bus = 1;
> +         if (libwacom_match_get_vendor_id(matches[nmatches]) == 
> libwacom_get_vendor_id(device))
> +                 found_vendor_id = 1;
> +         if (libwacom_match_get_product_id(matches[nmatches]) == 
> libwacom_get_product_id(device))
> +                 found_product_id = 1;
> +    }
> +
> +    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);



------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to