NT4 gdi test fix

Jakob Eriksson jakov at vmlinux.org
Fri Apr 15 16:18:27 CDT 2005


As per:

http://test.winehq.org/data/200504141000/nt4_IDWASEMPTY/gdi32:gdiobj.txt

MSDN shows:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_912s.asp

Explanation: the struct defined when the test is compiled may have 
records not present
in earlier versions of Windows.


-------------- next part --------------
Index: gdiobj.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/tests/gdiobj.c,v
retrieving revision 1.5
diff -u -r1.5 gdiobj.c
--- gdiobj.c	3 Jan 2005 20:19:32 -0000	1.5
+++ gdiobj.c	15 Apr 2005 21:16:18 -0000
@@ -49,8 +49,8 @@
     ok(hfont != 0, "CreateFontIndirect failed\n");
 
     ret = GetObjectA(hfont, sizeof(lfout), &lfout);
-    ok(ret == sizeof(lfout),
-       "GetObject returned %d expected %d\n", ret, sizeof(lfout));
+    ok(ret <= sizeof(lfout),
+       "GetObject returned %d expected <=%d\n", ret, sizeof(lfout));
 
     ok(!memcmp(&lfout, &lf, FIELD_OFFSET(LOGFONTA, lfFaceName)), "fonts don't match\n");
     ok(!lstrcmpA(lfout.lfFaceName, lf.lfFaceName),
@@ -161,7 +161,7 @@
 	assert(hfont);
 
 	ret = GetObject(hfont, sizeof(lf), &lf);
-	ok(ret == sizeof(lf), "GetObject failed: %d\n", ret);
+	ok(ret <= sizeof(lf), "GetObject returned %d, expected <= %d\n", ret, sizeof(lf));
 	ok(!memcmp(&bitmap_lf, &lf, FIELD_OFFSET(LOGFONTA, lfFaceName)), "fonts don't match\n");
 	ok(!lstrcmpA(bitmap_lf.lfFaceName, lf.lfFaceName),
 	   "font names don't match: %s != %s\n", bitmap_lf.lfFaceName, lf.lfFaceName);
@@ -177,7 +177,7 @@
     assert(hfont);
 
     ret = GetObject(hfont, sizeof(lf), &lf);
-    ok(ret == sizeof(lf), "GetObject failed: %d\n", ret);
+    ok(ret <= sizeof(lf), "GetObject returned %d, expected <= %d\n", ret, sizeof(lf));
     ok(!memcmp(&bitmap_lf, &lf, FIELD_OFFSET(LOGFONTA, lfFaceName)), "fonts don't match\n");
     ok(!lstrcmpA(bitmap_lf.lfFaceName, lf.lfFaceName),
        "font names don't match: %s != %s\n", bitmap_lf.lfFaceName, lf.lfFaceName);
@@ -194,7 +194,7 @@
     assert(hfont);
 
     ret = GetObject(hfont, sizeof(lf), &lf);
-    ok(ret == sizeof(lf), "GetObject failed: %d\n", ret);
+    ok(ret <= sizeof(lf), "GetObject returned %d, expected <= %d\n", ret, sizeof(lf));
     ok(!memcmp(&bitmap_lf, &lf, FIELD_OFFSET(LOGFONTA, lfFaceName)), "fonts don't match\n");
     ok(!lstrcmpA(bitmap_lf.lfFaceName, lf.lfFaceName),
        "font names don't match: %s != %s\n", bitmap_lf.lfFaceName, lf.lfFaceName);


More information about the wine-patches mailing list