gdi32/tests: Add test for SelectClipRgn in metafile.

This commit is contained in:
Ilya Shpigor 2009-09-07 10:57:55 +04:00 committed by Alexandre Julliard
parent 5f28a6a2d5
commit dad99e2aa9
1 changed files with 17 additions and 0 deletions

View File

@ -1908,6 +1908,7 @@ static void test_emf_clipping(void)
HENHMETAFILE hemf; HENHMETAFILE hemf;
HRGN hrgn; HRGN hrgn;
INT ret; INT ret;
RECT rc_res, rc_sclip;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL); hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL);
@ -1946,6 +1947,22 @@ static void test_emf_clipping(void)
DeleteEnhMetaFile(hemf); DeleteEnhMetaFile(hemf);
ReleaseDC(hwnd, hdc); ReleaseDC(hwnd, hdc);
DestroyWindow(hwnd); DestroyWindow(hwnd);
hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL);
SetRect(&rc_sclip, 100, 100, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
hrgn = CreateRectRgn(rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom);
SelectClipRgn(hdc, hrgn);
GetClipBox(hdc, &rc_res);
todo_wine ok(EqualRect(&rc_res, &rc_sclip),
"expected rc_res (%d, %d) - (%d, %d), got (%d, %d) - (%d, %d)\n",
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);
DeleteEnhMetaFile(hemf);
DeleteObject(hrgn);
DeleteDC(hdc);
} }
static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, INT nObj, LPARAM lpData) static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, INT nObj, LPARAM lpData)