[PATCH xserver 17/17] Test: Input: Add touch tests

Daniel Stone daniel at fooishbar.org
Fri Jan 7 08:03:27 PST 2011


Hi,

On Thu, Jan 06, 2011 at 10:29:12AM +1000, Peter Hutterer wrote:
> On Tue, Dec 28, 2010 at 05:58:08PM +0000, Daniel Stone wrote:
> > @@ -674,6 +705,20 @@ static void dix_grab_matching(void)
> >      g_assert(rc == TRUE);
> >      rc = GrabMatchesSecond(&b, &a, FALSE);
> >      g_assert(rc == TRUE);
> > +
> > +    /* A TouchMotion/TouchEnd grab must match a TouchBegin grab. */
> 
> add the case for XI_TouchEnd then, please.

Will do.

> > +    a.grabtype = GRABTYPE_XI2;
> > +    b.grabtype = GRABTYPE_XI2;
> > +    a.type = XI_TouchBegin;
> > +    b.type = XI_TouchMotion;
> > +    a.detail.exact = 0;
> > +    b.detail.exact = 0;
> > +    a.modifiersDetail.exact = 0;
> > +    b.modifiersDetail.exact = 0;
> > +    rc = GrabMatchesSecond(&a, &b, FALSE);
> > +    g_assert(rc == TRUE);
> > +    rc = GrabMatchesSecond(&b, &a, FALSE);
> > +    g_assert(rc == TRUE);
> > 
> > [...]
> > 
> > +static void touch_finish(void)
> > +{
> > +    DeviceIntRec dev;
> > +    TouchClassRec touch;
> > +    TouchPointInfoRec touches[2];
> > +    int touchid;
> > +
> > +    memset(&dev, 0, sizeof(dev));
> > +    memset(&touch, 0, sizeof(touch));
> > +    memset(touches, 0, sizeof(*touches) * 2);
> > +    touch.num_touches = 2;
> > +    touch.touches = touches;
> > +    dev.touch = &touch;
> > +    touchid = CreateTouchPoint(&dev, 0xdeadbeef);
> > +    g_assert(touchid >= 0);
> > +    FinishTouchPoint(&dev, 0xdeadbeef);
> > +    g_assert(touch.touches[touchid].active == FALSE);
> > +    g_assert(touch.touches[touchid].pending_finish == 0);
> > +    g_assert(touch.touches[touchid].num_listeners == 0);
> > +    g_assert(touch.touches[touchid].num_grabs == 0);
> > +    g_assert(touch.touches[touchid].sprite.spriteTraceGood == 0);
> 
> maybe make sure that FindTouchPoint won't find the deleted touch point
> anymore here.

Yep, seems fair.

> either way, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> though
> this one I guess will see changes as the server code moves.

Thanks! :)

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110107/7dc824c8/attachment-0001.pgp>


More information about the xorg-devel mailing list