[PATCH 1/2] user32: Add tests for MapWindowPoints, ClientToScreen and ScreenToClient.

Christian Costa titan.costa at gmail.com
Fri Nov 9 07:20:07 CST 2012


2012/11/9 Alexandre Julliard <julliard at winehq.org>

> Christian Costa <titan.costa at gmail.com> writes:
>
> > +    SetLastError(0xdeadbeef);
> > +    n = MapWindowPoints(wnd, NULL, NULL, 0);
> > +    err = GetLastError();
> > +    ok(n == ((window_rect.top << 16) | window_rect.left), "Got %x (%d,
> %d), expected %x (%d, %d)\n",
> > +       n, (n << 16) >> 16, n >> 16, window_rect.left, window_rect.top,
> (window_rect.top << 16) | window_rect.left);
> > +    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
> > +
> > +    SetLastError(0xdeadbeef);
> > +    n = MapWindowPoints(NULL, wnd, NULL, 0);
> > +    err = GetLastError();
> > +    ok(n == ((-window_rect.top << 16) | (-window_rect.left & 0xffff)),
> "Got %x (%d, %d), expected %x (%d, %d)\n",
> > +       n, (n << 16) >> 16, n >> 16, (-window_rect.top << 16) |
> (-window_rect.left & 0xffff), -window_rect.left, -window_rect.top);
> > +    ok(err == 0xdeadbeef, "Got %x, expected %x\n", err, 0xdeadbeef);
>
> Testing last error on success is not useful. Also please use MAKELONG
> and related macros instead of doing it by hand.
>
>
>
I can't use LOWORD as the signed bit is not propagated with & 0xffff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20121109/a60e0624/attachment.html>


More information about the wine-devel mailing list