Author: akhaldi
Date: Sun Jun  4 01:52:19 2017
New Revision: 74890

URL: http://svn.reactos.org/svn/reactos?rev=74890&view=rev
Log:
[UXTHEME_WINETEST] Sync with Wine Staging 2.9. CORE-13362

Modified:
    trunk/rostests/winetests/uxtheme/system.c

Modified: trunk/rostests/winetests/uxtheme/system.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/uxtheme/system.c?rev=74890&r1=74889&r2=74890&view=diff
==============================================================================
--- trunk/rostests/winetests/uxtheme/system.c   [iso-8859-1] (original)
+++ trunk/rostests/winetests/uxtheme/system.c   [iso-8859-1] Sun Jun  4 
01:52:19 2017
@@ -527,14 +527,42 @@
     ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
 }
 
+static void test_buffer_dc_props(HDC hdc, const RECT *rect)
+{
+    static const XFORM ident = { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f };
+    XFORM xform;
+    POINT org;
+    RECT box;
+    BOOL ret;
+
+    ret = GetWorldTransform(hdc, &xform);
+    ok(ret, "Failed to get world transform\n");
+    ok(!memcmp(&xform, &ident, sizeof(xform)), "Unexpected world transform\n");
+
+    ret = GetViewportOrgEx(hdc, &org);
+    ok(ret, "Failed to get vport origin\n");
+    ok(org.x == 0 && org.y == 0, "Unexpected vport origin\n");
+
+    ret = GetWindowOrgEx(hdc, &org);
+    ok(ret, "Failed to get vport origin\n");
+    ok(org.x == rect->left && org.y == rect->top, "Unexpected window 
origin\n");
+
+    ret = GetClipBox(hdc, &box);
+    ok(ret, "Failed to get clip box\n");
+    ok(box.left == rect->left && box.top == rect->top, "Unexpected clip 
box\n");
+
+    ok(GetGraphicsMode(hdc) == GM_COMPATIBLE, "wrong graphics mode\n");
+}
+
 static void test_buffered_paint(void)
 {
+    HDC target, src, hdc, screen_dc;
     BP_PAINTPARAMS params = { 0 };
     BP_BUFFERFORMAT format;
-    HDC target, src, hdc;
     HPAINTBUFFER buffer;
     RECT rect, rect2;
     RGBQUAD *bits;
+    HBITMAP hbm;
     HRESULT hr;
     int row;
 
@@ -673,6 +701,31 @@
 
     hr = pGetBufferedPaintBits(NULL, NULL, &row);
     ok(hr == E_POINTER, "Unexpected return code %#x\n", hr);
+
+    screen_dc = GetDC(0);
+
+    hdc = CreateCompatibleDC(screen_dc);
+    ok(hdc != NULL, "Failed to create a DC\n");
+    hbm = CreateCompatibleBitmap(screen_dc, 64, 64);
+    ok(hbm != NULL, "Failed to create a bitmap\n");
+    SelectObject(hdc, hbm);
+
+    ReleaseDC(0, screen_dc);
+
+    SetRect(&rect, 1, 2, 34, 56);
+
+    buffer = pBeginBufferedPaint(hdc, &rect, BPBF_COMPATIBLEBITMAP, NULL, 
&src);
+    test_buffer_dc_props(src, &rect);
+    hr = pEndBufferedPaint(buffer, FALSE);
+    ok(hr == S_OK, "Unexpected return code %#x\n", hr);
+
+    DeleteObject(hbm);
+    DeleteDC(hdc);
+
+    buffer = pBeginBufferedPaint(target, &rect, BPBF_COMPATIBLEBITMAP, NULL, 
&src);
+    test_buffer_dc_props(src, &rect);
+    hr = pEndBufferedPaint(buffer, FALSE);
+    ok(hr == S_OK, "Unexpected return code %#x\n", hr);
 
     /* access buffer bits */
     for (format = BPBF_COMPATIBLEBITMAP; format <= BPBF_TOPDOWNMONODIB; 
format++)
@@ -703,37 +756,16 @@
 {
     init_funcs();
 
-    /* No real functional tests will be done (yet). The current tests
+    /* No real functional theme API tests will be done (yet). The current tests
      * only show input/return behaviour
      */
 
-    /* IsThemeActive, IsAppThemed and IsThemePartDefined*/
-    trace("Starting test_IsThemed()\n");
     test_IsThemed();
-
-    /* GetWindowTheme */
-    trace("Starting test_GetWindowTheme()\n");
     test_GetWindowTheme();
-
-    /* SetWindowTheme */
-    trace("Starting test_SetWindowTheme()\n");
     test_SetWindowTheme();
-
-    /* OpenThemeData, a bit more functional now */
-    trace("Starting test_OpenThemeData()\n");
     test_OpenThemeData();
-
-    /* OpenThemeDataEx */
-    trace("Starting test_OpenThemeDataEx()\n");
     test_OpenThemeDataEx();
-
-    /* GetCurrentThemeName */
-    trace("Starting test_GetCurrentThemeName()\n");
     test_GetCurrentThemeName();
-
-    /* CloseThemeData */
-    trace("Starting test_CloseThemeData()\n");
     test_CloseThemeData();
-
     test_buffered_paint();
 }


Reply via email to