From 57b55a661de1d31dd07c5fb10a1e88250efc6785 Mon Sep 17 00:00:00 2001 From: Wilfried Pasquazzo Date: Wed, 14 Oct 2009 18:54:39 +0200 Subject: [PATCH] oleaut32/tests: Testcase for IPicture_Render with icons, check for drawing size and position. --- dlls/oleaut32/tests/olepicture.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 2dc1b05cf9..150fcf8c9e 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -594,6 +594,9 @@ static void test_Render(void) HRESULT hres; short type; PICTDESC desc; + OLE_XSIZE_HIMETRIC pWidth; + OLE_YSIZE_HIMETRIC pHeight; + COLORREF result; HDC hdc = GetDC(0); /* test IPicture::Render return code on uninitialized picture */ @@ -646,8 +649,28 @@ static void test_Render(void) ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 10, 10, NULL); ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); - IPicture_Release(pic); + /* Check if target size and position is respected */ + IPicture_get_Width(pic, &pWidth); + IPicture_get_Height(pic, &pHeight); + + SetPixelV(hdc, 0, 0, 0x00F0F0F0); + SetPixelV(hdc, 5, 5, 0x00F0F0F0); + SetPixelV(hdc, 10, 10, 0x00F0F0F0); + + IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL); + + result = GetPixel(hdc, 0, 0); + ok(result == 0x00F0F0F0, + "Color at 0,0 should be unchanged 0xF0F0F0, but was 0x%06X\n", result); + result = GetPixel(hdc, 5, 5); + ok(result != 0x00F0F0F0, + "Color at 5,5 should have changed, but still was 0x%06X\n", result); + result = GetPixel(hdc, 10, 10); + todo_wine ok(result == 0x00F0F0F0, + "Color at 10,10 should be unchanged 0xF0F0F0, but was 0x%06X\n", result); + + IPicture_Release(pic); ReleaseDC(NULL, hdc); }