On Wed, May 2, 2012 at 4:42 PM, Peter Hutterer <peter.hutte...@who-t.net> wrote: > Only few devices don't support erasers. Right now, that's only the DTI520 > in our database. We can assume that the default tablet has two tools - some > stylus, some eraser. > > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
Reviewed-by: Ping Cheng <pingli...@gmail.com> for the whole set. Ping > --- > test/tablet-validity.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/test/tablet-validity.c b/test/tablet-validity.c > index ded9bd1..195fa4e 100644 > --- a/test/tablet-validity.c > +++ b/test/tablet-validity.c > @@ -44,6 +44,7 @@ static void verify_tablet(WacomDevice *device) > { > const char *name; > int nstyli; > + unsigned int product; > > name = libwacom_get_name(device); > if (strcmp(name, "Generic") == 0) > @@ -66,7 +67,18 @@ static void verify_tablet(WacomDevice *device) > } > assert(libwacom_get_num_buttons(device) >= 0); > assert(libwacom_get_supported_styli(device, &nstyli) != 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(libwacom_get_ring_num_modes(device) >= 0); > assert(libwacom_get_ring2_num_modes(device) >= 0); > assert(libwacom_get_num_strips(device) >= 0); > -- > 1.7.10 > > > ------------------------------------------------------------------------------ > 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 ------------------------------------------------------------------------------ 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