Christian Costa titan.costa@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.
2012/11/9 Alexandre Julliard julliard@winehq.org
Christian Costa titan.costa@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.
Christian Costa titan.costa@gmail.com writes:
2012/11/9 Alexandre Julliard julliard@winehq.org 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.
You could always add a cast, but you don't really need it here. Printing fancy error messages is not useful anyway, they are not supposed to happen.