Wilfried Pasquazzo : oleaut32/tests: Testcase for IPicture_Render with icons, check for drawing size and position.

Alexandre Julliard julliard at winehq.org
Thu Oct 15 08:54:38 CDT 2009


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

Author: Wilfried Pasquazzo <wilfried.pasquazzo at gmail.com>
Date:   Wed Oct 14 18:54:39 2009 +0200

oleaut32/tests: Testcase for IPicture_Render with icons, check for drawing size and position.

---

 dlls/oleaut32/tests/olepicture.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
index 2dc1b05..150fcf8 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);
 }
 




More information about the wine-cvs mailing list