[ros-diffs] [jimtabor] 45642: - Sync to wine release 1.1.39.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun Feb 21 04:00:07 CET 2010


Author: jimtabor
Date: Sun Feb 21 04:00:07 2010
New Revision: 45642

URL: http://svn.reactos.org/svn/reactos?rev=45642&view=rev
Log:
- Sync to wine release 1.1.39.

Modified:
    trunk/rostests/winetests/gdi32/clipping.c
    trunk/rostests/winetests/gdi32/font.c

Modified: trunk/rostests/winetests/gdi32/clipping.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdi32/clipping.c?rev=45642&r1=45641&r2=45642&view=diff
==============================================================================
--- trunk/rostests/winetests/gdi32/clipping.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/gdi32/clipping.c [iso-8859-1] Sun Feb 21 04:00:07 2010
@@ -265,8 +265,96 @@
     DeleteObject(hrgn);
 }
 
+static void test_GetClipRgn(void)
+{
+    HDC hdc;
+    HRGN hrgn, hrgn2, hrgn3, hrgn4;
+    int ret;
+
+    /* Test calling GetClipRgn with NULL device context and region handles. */
+    ret = GetClipRgn(NULL, NULL);
+    ok(ret == -1, "Expected GetClipRgn to return -1, got %d\n", ret);
+
+    hdc = GetDC(NULL);
+    ok(hdc != NULL, "Expected GetDC to return a valid device context handle\n");
+
+    /* Test calling GetClipRgn with a valid device context and NULL region. */
+    ret = GetClipRgn(hdc, NULL);
+    ok(ret == 0 ||
+       ret == -1 /* Win9x */,
+       "Expected GetClipRgn to return 0, got %d\n", ret);
+
+    /* Initialize the test regions. */
+    hrgn = CreateRectRgn(100, 100, 100, 100);
+    ok(hrgn != NULL,
+       "Expected CreateRectRgn to return a handle to a new rectangular region\n");
+
+    hrgn2 = CreateRectRgn(1, 2, 3, 4);
+    ok(hrgn2 != NULL,
+       "Expected CreateRectRgn to return a handle to a new rectangular region\n");
+
+    hrgn3 = CreateRectRgn(1, 2, 3, 4);
+    ok(hrgn3 != NULL,
+       "Expected CreateRectRgn to return a handle to a new rectangular region\n");
+
+    hrgn4 = CreateRectRgn(1, 2, 3, 4);
+    ok(hrgn4 != NULL,
+       "Expected CreateRectRgn to return a handle to a new rectangular region\n");
+
+    /* Try getting a clipping region from the device context
+     * when the device context's clipping region isn't set. */
+    ret = GetClipRgn(hdc, hrgn2);
+    ok(ret == 0, "Expected GetClipRgn to return 0, got %d\n", ret);
+
+    /* The region passed to GetClipRgn should be unchanged. */
+    ret = EqualRgn(hrgn2, hrgn3);
+    ok(ret == 1,
+       "Expected EqualRgn to compare the two regions as equal, got %d\n", ret);
+
+    /* Try setting and getting back a clipping region. */
+    ret = SelectClipRgn(hdc, hrgn);
+    ok(ret == NULLREGION,
+       "Expected SelectClipRgn to return NULLREGION, got %d\n", ret);
+
+    /* Passing a NULL region handle when the device context
+     * has a clipping region results in an error. */
+    ret = GetClipRgn(hdc, NULL);
+    ok(ret == -1, "Expected GetClipRgn to return -1, got %d\n", ret);
+
+    ret = GetClipRgn(hdc, hrgn2);
+    ok(ret == 1, "Expected GetClipRgn to return 1, got %d\n", ret);
+
+    ret = EqualRgn(hrgn, hrgn2);
+    ok(ret == 1,
+       "Expected EqualRgn to compare the two regions as equal, got %d\n", ret);
+
+    /* Try unsetting and then query the clipping region. */
+    ret = SelectClipRgn(hdc, NULL);
+    ok(ret == SIMPLEREGION,
+       "Expected SelectClipRgn to return SIMPLEREGION, got %d\n", ret);
+
+    ret = GetClipRgn(hdc, NULL);
+    ok(ret == 0 ||
+       ret == -1 /* Win9x */,
+       "Expected GetClipRgn to return 0, got %d\n", ret);
+
+    ret = GetClipRgn(hdc, hrgn3);
+    ok(ret == 0, "Expected GetClipRgn to return 0, got %d\n", ret);
+
+    ret = EqualRgn(hrgn3, hrgn4);
+    ok(ret == 1,
+       "Expected EqualRgn to compare the two regions as equal, got %d\n", ret);
+
+    DeleteObject(hrgn4);
+    DeleteObject(hrgn3);
+    DeleteObject(hrgn2);
+    DeleteObject(hrgn);
+    ReleaseDC(NULL, hdc);
+}
+
 START_TEST(clipping)
 {
     test_GetRandomRgn();
     test_ExtCreateRegion();
-}
+    test_GetClipRgn();
+}

Modified: trunk/rostests/winetests/gdi32/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdi32/font.c?rev=45642&r1=45641&r2=45642&view=diff
==============================================================================
--- trunk/rostests/winetests/gdi32/font.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/gdi32/font.c [iso-8859-1] Sun Feb 21 04:00:07 2010
@@ -307,9 +307,6 @@
     TEXTMETRICA tm_orig;
     SIZE size_orig;
     INT ret, i, width_orig, height_orig, scale, lfWidth;
-
-    skip("ROS-HACK: Skipping bitmap font tests!\n");
-    return;
 
     hdc = GetDC(0);
 
@@ -2851,7 +2848,7 @@
 static void test_oemcharset(void)
 {
     HDC hdc;
-    LOGFONTA lf;
+    LOGFONTA lf, clf;
     HFONT hfont, old_hfont;
     int charset;
 
@@ -2866,7 +2863,12 @@
     charset = GetTextCharset(hdc);
 todo_wine
     ok(charset == OEM_CHARSET, "expected %d charset, got %d\n", OEM_CHARSET, charset);
-    SelectObject(hdc, old_hfont);
+    hfont = SelectObject(hdc, old_hfont);
+    GetObjectA(hfont, sizeof(clf), &clf);
+    ok(!lstrcmpA(clf.lfFaceName, lf.lfFaceName), "expected %s face name, got %s\n", lf.lfFaceName, clf.lfFaceName);
+    ok(clf.lfPitchAndFamily == lf.lfPitchAndFamily, "expected %x family, got %x\n", lf.lfPitchAndFamily, clf.lfPitchAndFamily);
+    ok(clf.lfCharSet == lf.lfCharSet, "expected %d charset, got %d\n", lf.lfCharSet, clf.lfCharSet);
+    ok(clf.lfHeight == lf.lfHeight, "expected %d height, got %d\n", lf.lfHeight, clf.lfHeight);
     DeleteObject(hfont);
     DeleteDC(hdc);
 }




More information about the Ros-diffs mailing list