mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
user32/tests: Allow an approximate color match for the cursor contents.
This commit is contained in:
parent
4a14811527
commit
8d50342858
1 changed files with 6 additions and 4 deletions
|
@ -1405,6 +1405,7 @@ static int check_cursor_data( HDC hdc, HCURSOR hCursor, void *data, int length)
|
|||
BITMAPINFO *info;
|
||||
ICONINFO iinfo;
|
||||
DWORD ret;
|
||||
int i;
|
||||
|
||||
ret = GetIconInfo( hCursor, &iinfo );
|
||||
ok(ret, "GetIconInfo() failed\n");
|
||||
|
@ -1430,10 +1431,11 @@ static int check_cursor_data( HDC hdc, HCURSOR hCursor, void *data, int length)
|
|||
if (!image) goto cleanup;
|
||||
ret = GetDIBits( hdc, iinfo.hbmColor, 0, 32, image, info, DIB_RGB_COLORS );
|
||||
ok(ret, "GetDIBits() failed\n");
|
||||
if (!ret) goto cleanup;
|
||||
ret = (memcmp(image, data, length) == 0);
|
||||
ok(ret, "Expected 0x%x, actually 0x%x (first 4 bytes only)\n", *(DWORD *)data, *(DWORD *)image);
|
||||
|
||||
for (i = 0; ret && i < length / sizeof(COLORREF); i++)
|
||||
{
|
||||
ret = color_match( ((COLORREF *)data)[i], ((COLORREF *)image)[i] );
|
||||
ok(ret, "%04x: Expected 0x%x, actually 0x%x\n", i, ((COLORREF *)data)[i], ((COLORREF *)image)[i] );
|
||||
}
|
||||
cleanup:
|
||||
HeapFree( GetProcessHeap(), 0, image );
|
||||
HeapFree( GetProcessHeap(), 0, info );
|
||||
|
|
Loading…
Reference in a new issue