Em Fri, 2012-05-18 às 09:37 +1000, Peter Hutterer escreveu:
> We don't need to special-case the device, this device may be used with a pen
> that includes an eraser. Removing the special case means we expect all
> currently known devices to have at least two styli defined.

That's a wrong expectation. You should test whether they all have at
least one stylus defined, and for the stylus that claim to have an
eraser tip to have it defined and listed.

That'll stop broken definitions like this:
http://linuxwacom.git.sourceforge.net/git/gitweb.cgi?p=linuxwacom/libwacom;a=commit;h=e65080cd10ee9e5fca50d517bad2d1dd877d2b78

So should be:
assert(nstyli >= 1);

> Quote Ping Cheng, 17 May 2012,
> linuxwacom-devel, Thread: Add support for the DTI-520
> "DTI-520 is a protocol 4 (V4) device. It does not support serial number
> and tool IDs. [...] This is the same as Graphires. Even if the pen included
> in the box does not have eraser, user may use a pen with eraser."
> 
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
> Fixes make check regression introduced with 8227f3f6 and 4a7a7f16
> 
>  test/tablet-validity.c |   14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/test/tablet-validity.c b/test/tablet-validity.c
> index 8f33cb5..c8510e9 100644
> --- a/test/tablet-validity.c
> +++ b/test/tablet-validity.c
> @@ -59,7 +59,6 @@ static void verify_tablet(WacomDeviceDatabase *db, 
> WacomDevice *device)
>  {
>       const char *name;
>       const int *styli;
> -     unsigned int product;
>       int nstyli, i;
>  
>       name = libwacom_get_name(device);
> @@ -85,18 +84,7 @@ static void verify_tablet(WacomDeviceDatabase *db, 
> WacomDevice *device)
>  
>       styli = libwacom_get_supported_styli(device, &nstyli);
>       assert(styli != NULL);
> -     assert(nstyli > 0);
> -
> -     product = libwacom_get_vendor_id(device) << 16 | 
> libwacom_get_product_id(device);
> -     switch(product) {
> -             /* Devices known not have erasers. */
> -             case 0x056a003a: /* DTI520*/
> -                     assert(nstyli == 1);
> -                     break;
> -             default:
> -                     assert(nstyli > 1);
> -                     break;
> -     }
> +     assert(nstyli > 1);
>  
>       switch(libwacom_get_class(device)) {
>               case WCLASS_BAMBOO:



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to