Alexandre Julliard : user32/tests: Allow an approximate color match for the cursor contents.

Alexandre Julliard julliard at winehq.org
Fri Sep 9 10:56:45 CDT 2011


Module: wine
Branch: master
Commit: 8d503428587e88e4e87770d89aa799927014b6dc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8d503428587e88e4e87770d89aa799927014b6dc

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep  8 23:52:02 2011 +0200

user32/tests: Allow an approximate color match for the cursor contents.

---

 dlls/user32/tests/cursoricon.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c
index c874924..6e13fc0 100644
--- a/dlls/user32/tests/cursoricon.c
+++ b/dlls/user32/tests/cursoricon.c
@@ -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 );




More information about the wine-cvs mailing list