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

Alexandre Julliard julliard at winehq.org
Fri Nov 9 04:58:05 CST 2012


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.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list