Commit 75426bb9 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

gdi32/tests: Use wine_dbgstr_rect() to print RECTs.

Two old (win95 and winnt) broken() removed en passant. Signed-off-by: 's avatarMichael Stefaniuc <mstefani@redhat.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 085a538d
...@@ -54,8 +54,7 @@ static void test_GetRandomRgn(void) ...@@ -54,8 +54,7 @@ static void test_GetRandomRgn(void)
ret = GetRandomRgn(hdc, hrgn, 1); ret = GetRandomRgn(hdc, hrgn, 1);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
ret = GetRandomRgn(hdc, hrgn, 2); ret = GetRandomRgn(hdc, hrgn, 2);
ok(ret == 0, "GetRandomRgn rets %d\n", ret); ok(ret == 0, "GetRandomRgn rets %d\n", ret);
...@@ -63,8 +62,7 @@ static void test_GetRandomRgn(void) ...@@ -63,8 +62,7 @@ static void test_GetRandomRgn(void)
ret = GetRandomRgn(hdc, hrgn, 3); ret = GetRandomRgn(hdc, hrgn, 3);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
/* Move the clip to the meta and clear the clip */ /* Move the clip to the meta and clear the clip */
SetMetaRgn(hdc); SetMetaRgn(hdc);
...@@ -74,14 +72,12 @@ static void test_GetRandomRgn(void) ...@@ -74,14 +72,12 @@ static void test_GetRandomRgn(void)
ret = GetRandomRgn(hdc, hrgn, 2); ret = GetRandomRgn(hdc, hrgn, 2);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
ret = GetRandomRgn(hdc, hrgn, 3); ret = GetRandomRgn(hdc, hrgn, 3);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
/* Set a new clip (still got the meta) */ /* Set a new clip (still got the meta) */
SetRect(&rc2, 10, 30, 70, 90); SetRect(&rc2, 10, 30, 70, 90);
...@@ -90,22 +86,19 @@ static void test_GetRandomRgn(void) ...@@ -90,22 +86,19 @@ static void test_GetRandomRgn(void)
ret = GetRandomRgn(hdc, hrgn, 1); ret = GetRandomRgn(hdc, hrgn, 1);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc2, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc2, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
ret = GetRandomRgn(hdc, hrgn, 2); ret = GetRandomRgn(hdc, hrgn, 2);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
IntersectRect(&rc2, &rc, &rc2); IntersectRect(&rc2, &rc, &rc2);
ret = GetRandomRgn(hdc, hrgn, 3); ret = GetRandomRgn(hdc, hrgn, 3);
ok(ret != 0, "GetRandomRgn rets %d\n", ret); ok(ret != 0, "GetRandomRgn rets %d\n", ret);
GetRgnBox(hrgn, &ret_rc); GetRgnBox(hrgn, &ret_rc);
ok(EqualRect(&rc2, &ret_rc), "GetRandomRgn %d,%d - %d,%d\n", ok(EqualRect(&rc2, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
ret = GetRandomRgn(hdc, hrgn, SYSRGN); ret = GetRandomRgn(hdc, hrgn, SYSRGN);
...@@ -115,10 +108,7 @@ static void test_GetRandomRgn(void) ...@@ -115,10 +108,7 @@ static void test_GetRandomRgn(void)
OffsetRect(&window_rc, -window_rc.left, -window_rc.top); OffsetRect(&window_rc, -window_rc.left, -window_rc.top);
/* the window may be partially obscured so the region may be smaller */ /* the window may be partially obscured so the region may be smaller */
IntersectRect( &window_rc, &ret_rc, &ret_rc ); IntersectRect( &window_rc, &ret_rc, &ret_rc );
ok(EqualRect(&window_rc, &ret_rc) || ok(EqualRect(&window_rc, &ret_rc), "GetRandomRgn %s\n", wine_dbgstr_rect(&ret_rc));
broken(IsRectEmpty(&ret_rc)), /* win95 */
"GetRandomRgn %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);
DeleteObject(hrgn); DeleteObject(hrgn);
ReleaseDC(hwnd, hdc); ReleaseDC(hwnd, hdc);
...@@ -149,15 +139,13 @@ static void verify_region(HRGN hrgn, const RECT *rc) ...@@ -149,15 +139,13 @@ static void verify_region(HRGN hrgn, const RECT *rc)
else else
ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret); ok(ret == sizeof(rgn.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret);
trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n", trace("size %u, type %u, count %u, rgn size %u, bound %s\n",
rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.dwSize, rgn.data.rdh.iType, rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize,
rgn.data.rdh.nCount, rgn.data.rdh.nRgnSize, wine_dbgstr_rect(&rgn.data.rdh.rcBound));
rgn.data.rdh.rcBound.left, rgn.data.rdh.rcBound.top,
rgn.data.rdh.rcBound.right, rgn.data.rdh.rcBound.bottom);
if (rgn.data.rdh.nCount != 0) if (rgn.data.rdh.nCount != 0)
{ {
rect = (const RECT *)rgn.data.Buffer; rect = (const RECT *)rgn.data.Buffer;
trace("rect (%d,%d-%d,%d)\n", rect->left, rect->top, rect->right, rect->bottom); trace("rect %s\n", wine_dbgstr_rect(rect));
ok(EqualRect(rect, rc), "rects don't match\n"); ok(EqualRect(rect, rc), "rects don't match\n");
} }
...@@ -415,7 +403,7 @@ static void test_memory_dc_clipping(void) ...@@ -415,7 +403,7 @@ static void test_memory_dc_clipping(void)
ret = GetRgnBox(hrgn, &rc); ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == 1 && rc.bottom == 1, ok(rc.left == 0 && rc.top == 0 && rc.right == 1 && rc.bottom == 1,
"expected 0,0-1,1, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom); "expected 0,0-1,1, got %s\n", wine_dbgstr_rect(&rc));
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY); ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
...@@ -440,15 +428,15 @@ static void test_memory_dc_clipping(void) ...@@ -440,15 +428,15 @@ static void test_memory_dc_clipping(void)
ret = GetRgnBox(hrgn, &rc); ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100, ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100,
"expected 0,0-100,100, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom); "expected 0,0-100,100, got %s\n", wine_dbgstr_rect(&rc));
SetRect( &rc, 10, 10, 20, 20 ); SetRect( &rc, 10, 10, 20, 20 );
ret = RectVisible( hdc, &rc ); ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom ); ok(ret, "RectVisible failed for %s\n", wine_dbgstr_rect(&rc));
SetRect( &rc, 20, 20, 10, 10 ); SetRect( &rc, 20, 20, 10, 10 );
ret = RectVisible( hdc, &rc ); ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom ); ok(ret, "RectVisible failed for %s\n", wine_dbgstr_rect(&rc));
ret = ExtSelectClipRgn(hdc, 0, RGN_DIFF); ret = ExtSelectClipRgn(hdc, 0, RGN_DIFF);
ok(ret == 0, "expected 0, got %d\n", ret); ok(ret == 0, "expected 0, got %d\n", ret);
...@@ -459,7 +447,7 @@ static void test_memory_dc_clipping(void) ...@@ -459,7 +447,7 @@ static void test_memory_dc_clipping(void)
ret = GetRgnBox(hrgn, &rc); ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100, ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100,
"expected 0,0-100,100, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom); "expected 0,0-100,100, got %s\n", wine_dbgstr_rect(&rc));
DeleteDC(hdc); DeleteDC(hdc);
DeleteObject(hrgn); DeleteObject(hrgn);
...@@ -510,17 +498,16 @@ static void test_window_dc_clipping(void) ...@@ -510,17 +498,16 @@ static void test_window_dc_clipping(void)
ret = GetRgnBox(hrgn, &rc); ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", ok(EqualRect(&rc, &virtual_rect), "expected %s, got %s\n", wine_dbgstr_rect(&virtual_rect),
virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, wine_dbgstr_rect(&rc));
rc.left, rc.top, rc.right, rc.bottom);
SetRect( &rc, 10, 10, 20, 20 ); SetRect( &rc, 10, 10, 20, 20 );
ret = RectVisible( hdc, &rc ); ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom ); ok( ret, "RectVisible failed for %s\n", wine_dbgstr_rect(&rc));
SetRect( &rc, 20, 20, 10, 10 ); SetRect( &rc, 20, 20, 10, 10 );
ret = RectVisible( hdc, &rc ); ret = RectVisible( hdc, &rc );
ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom ); ok( ret, "RectVisible failed for %s\n", wine_dbgstr_rect(&rc));
ret = ExtSelectClipRgn(hdc, 0, RGN_DIFF); ret = ExtSelectClipRgn(hdc, 0, RGN_DIFF);
ok(ret == 0, "expected 0, got %d\n", ret); ok(ret == 0, "expected 0, got %d\n", ret);
...@@ -530,9 +517,8 @@ static void test_window_dc_clipping(void) ...@@ -530,9 +517,8 @@ static void test_window_dc_clipping(void)
ret = GetRgnBox(hrgn, &rc); ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", ok(EqualRect(&rc, &virtual_rect), "expected %s, got %s\n", wine_dbgstr_rect(&virtual_rect),
virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, wine_dbgstr_rect(&rc));
rc.left, rc.top, rc.right, rc.bottom);
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY); ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1), ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1),
......
...@@ -1271,7 +1271,7 @@ static void compare_bounds( HDC hdc, const char *info ) ...@@ -1271,7 +1271,7 @@ static void compare_bounds( HDC hdc, const char *info )
current_bounds->right == -1 && current_bounds->right == -1 &&
current_bounds->bottom == -1) current_bounds->bottom == -1)
{ {
ok( 0, "missing bounds, got { %d, %d, %d, %d },\n", rect.left, rect.top, rect.right, rect.bottom ); ok( 0, "missing bounds, got %s,\n", wine_dbgstr_rect( &rect ));
return; return;
} }
......
...@@ -309,27 +309,22 @@ static void test_dc_layout(void) ...@@ -309,27 +309,22 @@ static void test_dc_layout(void)
hrgn = CreateRectRgn( 0, 0, 0, 0 ); hrgn = CreateRectRgn( 0, 0, 0, 0 );
GetClipRgn( hdc, hrgn ); GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
pSetLayout( hdc, LAYOUT_LTR ); pSetLayout( hdc, LAYOUT_LTR );
SetRect( &rc, 80, 10, 90, 20 ); SetRect( &rc, 80, 10, 90, 20 );
GetClipRgn( hdc, hrgn ); GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc ); GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
IntersectClipRect( hdc, 80, 10, 85, 20 ); IntersectClipRect( hdc, 80, 10, 85, 20 );
pSetLayout( hdc, LAYOUT_RTL ); pSetLayout( hdc, LAYOUT_RTL );
SetRect( &rc, 15, 10, 20, 20 ); SetRect( &rc, 15, 10, 20, 20 );
GetClipRgn( hdc, hrgn ); GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc ); GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
SetRectRgn( hrgn, 60, 10, 80, 20 ); SetRectRgn( hrgn, 60, 10, 80, 20 );
pSetLayout( hdc, LAYOUT_LTR ); pSetLayout( hdc, LAYOUT_LTR );
ExtSelectClipRgn( hdc, hrgn, RGN_OR ); ExtSelectClipRgn( hdc, hrgn, RGN_OR );
...@@ -337,19 +332,16 @@ static void test_dc_layout(void) ...@@ -337,19 +332,16 @@ static void test_dc_layout(void)
SetRect( &rc, 15, 10, 40, 20 ); SetRect( &rc, 15, 10, 40, 20 );
GetClipRgn( hdc, hrgn ); GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc ); GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
/* OffsetClipRgn mirrors too */ /* OffsetClipRgn mirrors too */
OffsetClipRgn( hdc, 5, 5 ); OffsetClipRgn( hdc, 5, 5 );
OffsetRect( &rc, 5, 5 ); OffsetRect( &rc, 5, 5 );
GetClipRgn( hdc, hrgn ); GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
/* GetRandomRgn returns the raw region */ /* GetRandomRgn returns the raw region */
if (pGetRandomRgn) if (pGetRandomRgn)
...@@ -357,8 +349,7 @@ static void test_dc_layout(void) ...@@ -357,8 +349,7 @@ static void test_dc_layout(void)
SetRect( &rc, 55, 15, 80, 25 ); SetRect( &rc, 55, 15, 80, 25 );
pGetRandomRgn( hdc, hrgn, 1 ); pGetRandomRgn( hdc, hrgn, 1 );
GetRgnBox( hrgn, &ret_rc ); GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n", ok( EqualRect( &rc, &ret_rc ), "wrong clip box %s\n", wine_dbgstr_rect( &ret_rc ));
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
} }
SetMapMode(hdc, MM_LOMETRIC); SetMapMode(hdc, MM_LOMETRIC);
......
...@@ -2508,16 +2508,15 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ...@@ -2508,16 +2508,15 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
rgn1 = (const union _rgn *)clip->RgnData; rgn1 = (const union _rgn *)clip->RgnData;
trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n", trace("size %u, type %u, count %u, rgn size %u, bound %s\n",
rgn1->data.rdh.dwSize, rgn1->data.rdh.iType, rgn1->data.rdh.dwSize, rgn1->data.rdh.iType,
rgn1->data.rdh.nCount, rgn1->data.rdh.nRgnSize, rgn1->data.rdh.nCount, rgn1->data.rdh.nRgnSize,
rgn1->data.rdh.rcBound.left, rgn1->data.rdh.rcBound.top, wine_dbgstr_rect(&rgn1->data.rdh.rcBound));
rgn1->data.rdh.rcBound.right, rgn1->data.rdh.rcBound.bottom);
ok(EqualRect(&rgn1->data.rdh.rcBound, rc), "rects don't match\n"); ok(EqualRect(&rgn1->data.rdh.rcBound, rc), "rects don't match\n");
rect = *(const RECT *)rgn1->data.Buffer; rect = *(const RECT *)rgn1->data.Buffer;
trace("rect (%d,%d-%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom); trace("rect %s\n", wine_dbgstr_rect(&rect));
ok(EqualRect(&rect, rc), "rects don't match\n"); ok(EqualRect(&rect, rc), "rects don't match\n");
ok(rgn1->data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn1->data.rdh.dwSize); ok(rgn1->data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn1->data.rdh.dwSize);
...@@ -2555,25 +2554,21 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table, ...@@ -2555,25 +2554,21 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ret = GetRegionData(hrgn, sizeof(rgn2), &rgn2.data); ret = GetRegionData(hrgn, sizeof(rgn2), &rgn2.data);
ok(ret == sizeof(rgn2), "expected sizeof(rgn2), got %u\n", ret); ok(ret == sizeof(rgn2), "expected sizeof(rgn2), got %u\n", ret);
trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n", trace("size %u, type %u, count %u, rgn size %u, bound %s\n", rgn2.data.rdh.dwSize,
rgn2.data.rdh.dwSize, rgn2.data.rdh.iType, rgn2.data.rdh.iType, rgn2.data.rdh.nCount, rgn2.data.rdh.nRgnSize,
rgn2.data.rdh.nCount, rgn2.data.rdh.nRgnSize, wine_dbgstr_rect(&rgn2.data.rdh.rcBound));
rgn2.data.rdh.rcBound.left, rgn2.data.rdh.rcBound.top,
rgn2.data.rdh.rcBound.right, rgn2.data.rdh.rcBound.bottom);
rect = rgn2.data.rdh.rcBound; rect = rgn2.data.rdh.rcBound;
rc_transformed = *rc; rc_transformed = *rc;
translate((POINT *)&rc_transformed, 2, &xform); translate((POINT *)&rc_transformed, 2, &xform);
trace("transformed (%d,%d-%d,%d)\n", rc_transformed.left, rc_transformed.top, trace("transformed %s\n", wine_dbgstr_rect(&rc_transformed));
rc_transformed.right, rc_transformed.bottom);
ok(is_equal_rect(&rect, &rc_transformed), "rects don't match\n"); ok(is_equal_rect(&rect, &rc_transformed), "rects don't match\n");
rect = *(const RECT *)rgn2.data.Buffer; rect = *(const RECT *)rgn2.data.Buffer;
trace("rect (%d,%d-%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom); trace("rect %s\n", wine_dbgstr_rect(&rect));
rc_transformed = *rc; rc_transformed = *rc;
translate((POINT *)&rc_transformed, 2, &xform); translate((POINT *)&rc_transformed, 2, &xform);
trace("transformed (%d,%d-%d,%d)\n", rc_transformed.left, rc_transformed.top, trace("transformed %s\n", wine_dbgstr_rect(&rc_transformed));
rc_transformed.right, rc_transformed.bottom);
ok(is_equal_rect(&rect, &rc_transformed), "rects don't match\n"); ok(is_equal_rect(&rect, &rc_transformed), "rects don't match\n");
ok(rgn2.data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn2.data.rdh.dwSize); ok(rgn2.data.rdh.dwSize == sizeof(rgn1->data.rdh), "expected sizeof(rdh), got %u\n", rgn2.data.rdh.dwSize);
...@@ -2645,10 +2640,8 @@ static void test_emf_clipping(void) ...@@ -2645,10 +2640,8 @@ static void test_emf_clipping(void)
SetRect(&rc_res, -1, -1, -1, -1); SetRect(&rc_res, -1, -1, -1, -1);
ret = GetClipBox(hdc, &rc_res); ret = GetClipBox(hdc, &rc_res);
ok(ret == SIMPLEREGION, "got %d\n", ret); ok(ret == SIMPLEREGION, "got %d\n", ret);
ok(EqualRect(&rc_res, &rc_sclip), ok(EqualRect(&rc_res, &rc_sclip), "expected %s, got %s\n", wine_dbgstr_rect(&rc_sclip),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&rc_res));
rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom,
rc_res.left, rc_res.top, rc_res.right, rc_res.bottom);
OffsetRect(&rc_sclip, -100, -100); OffsetRect(&rc_sclip, -100, -100);
ret = OffsetClipRgn(hdc, -100, -100); ret = OffsetClipRgn(hdc, -100, -100);
...@@ -2656,10 +2649,8 @@ static void test_emf_clipping(void) ...@@ -2656,10 +2649,8 @@ static void test_emf_clipping(void)
SetRect(&rc_res, -1, -1, -1, -1); SetRect(&rc_res, -1, -1, -1, -1);
ret = GetClipBox(hdc, &rc_res); ret = GetClipBox(hdc, &rc_res);
ok(ret == SIMPLEREGION, "got %d\n", ret); ok(ret == SIMPLEREGION, "got %d\n", ret);
ok(EqualRect(&rc_res, &rc_sclip), ok(EqualRect(&rc_res, &rc_sclip), "expected %s, got %s\n", wine_dbgstr_rect(&rc_sclip),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&rc_res));
rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom,
rc_res.left, rc_res.top, rc_res.right, rc_res.bottom);
ret = IntersectClipRect(hdc, 0, 0, 100, 100); ret = IntersectClipRect(hdc, 0, 0, 100, 100);
ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION) /* XP */, "got %d\n", ret); ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION) /* XP */, "got %d\n", ret);
...@@ -2674,10 +2665,8 @@ static void test_emf_clipping(void) ...@@ -2674,10 +2665,8 @@ static void test_emf_clipping(void)
SetRect(&rc_res, -1, -1, -1, -1); SetRect(&rc_res, -1, -1, -1, -1);
ret = GetClipBox(hdc, &rc_res); ret = GetClipBox(hdc, &rc_res);
ok(ret == SIMPLEREGION, "got %d\n", ret); ok(ret == SIMPLEREGION, "got %d\n", ret);
ok(EqualRect(&rc_res, &rc), ok(EqualRect(&rc_res, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rc),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&rc_res));
rc.left, rc.top, rc.right, rc.bottom,
rc_res.left, rc_res.top, rc_res.right, rc_res.bottom);
SetRect(&rc_sclip, 0, 0, 100, 50); SetRect(&rc_sclip, 0, 0, 100, 50);
ret = ExcludeClipRect(hdc, 0, 50, 100, 100); ret = ExcludeClipRect(hdc, 0, 50, 100, 100);
...@@ -2693,10 +2682,8 @@ static void test_emf_clipping(void) ...@@ -2693,10 +2682,8 @@ static void test_emf_clipping(void)
SetRect(&rc_res, -1, -1, -1, -1); SetRect(&rc_res, -1, -1, -1, -1);
ret = GetClipBox(hdc, &rc_res); ret = GetClipBox(hdc, &rc_res);
ok(ret == SIMPLEREGION, "got %d\n", ret); ok(ret == SIMPLEREGION, "got %d\n", ret);
ok(EqualRect(&rc_res, &rc_sclip), ok(EqualRect(&rc_res, &rc_sclip), "expected %s, got %s\n", wine_dbgstr_rect(&rc_sclip),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&rc_res));
rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom,
rc_res.left, rc_res.top, rc_res.right, rc_res.bottom);
hemf = CloseEnhMetaFile(hdc); hemf = CloseEnhMetaFile(hdc);
DeleteEnhMetaFile(hemf); DeleteEnhMetaFile(hemf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment