Wilfried Pasquazzo : oleaut32: Updated IPicture_Render testcase to pass on all older Windows.
Alexandre Julliard
julliard at winehq.org
Mon Oct 19 09:56:10 CDT 2009
Module: wine
Branch: master
Commit: a00d2235aac2d5e719c95933d1cd20233f81019d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a00d2235aac2d5e719c95933d1cd20233f81019d
Author: Wilfried Pasquazzo <wilfried.pasquazzo at gmail.com>
Date: Sun Oct 18 20:42:47 2009 +0200
oleaut32: Updated IPicture_Render testcase to pass on all older Windows.
---
dlls/oleaut32/tests/olepicture.c | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
index 42f58ae..55d883b 100644
--- a/dlls/oleaut32/tests/olepicture.c
+++ b/dlls/oleaut32/tests/olepicture.c
@@ -596,7 +596,7 @@ static void test_Render(void)
PICTDESC desc;
OLE_XSIZE_HIMETRIC pWidth;
OLE_YSIZE_HIMETRIC pHeight;
- COLORREF result;
+ COLORREF result, expected;
HDC hdc = GetDC(0);
/* test IPicture::Render return code on uninitialized picture */
@@ -657,18 +657,29 @@ static void test_Render(void)
SetPixelV(hdc, 0, 0, 0x00F0F0F0);
SetPixelV(hdc, 5, 5, 0x00F0F0F0);
SetPixelV(hdc, 10, 10, 0x00F0F0F0);
+ expected = GetPixel(hdc, 0, 0);
- IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL);
+ hres = IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL);
+ ole_expect(hres, S_OK);
+
+ if(hres != S_OK) {
+ IPicture_Release(pic);
+ ReleaseDC(NULL, hdc);
+ return;
+ }
+ /* Evaluate the rendered Icon */
result = GetPixel(hdc, 0, 0);
- ok(result == 0x00F0F0F0,
- "Color at 0,0 should be unchanged 0xF0F0F0, but was 0x%06X\n", result);
+ ok(result == expected,
+ "Color at 0,0 should be unchanged 0x%06X, but was 0x%06X\n", expected, result);
result = GetPixel(hdc, 5, 5);
- ok(result != 0x00F0F0F0,
- "Color at 5,5 should have changed, but still was 0x%06X\n", result);
+ ok(result != expected ||
+ broken(result == expected), /* WinNT 4.0 and older may claim they drew */
+ /* the icon, even if they didn't. */
+ "Color at 5,5 should have changed, but still was 0x%06X\n", expected);
result = GetPixel(hdc, 10, 10);
- ok(result == 0x00F0F0F0,
- "Color at 10,10 should be unchanged 0xF0F0F0, but was 0x%06X\n", result);
+ ok(result == expected,
+ "Color at 10,10 should be unchanged 0x%06X, but was 0x%06X\n", expected, result);
IPicture_Release(pic);
ReleaseDC(NULL, hdc);
More information about the wine-cvs
mailing list