From dad99e2aa943bf63e06b0c1be089411131fdd864 Mon Sep 17 00:00:00 2001 From: Ilya Shpigor Date: Mon, 7 Sep 2009 10:57:55 +0400 Subject: [PATCH] gdi32/tests: Add test for SelectClipRgn in metafile. --- dlls/gdi32/tests/metafile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 15a2c631e6b..a186608c0ac 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -1908,6 +1908,7 @@ static void test_emf_clipping(void) HENHMETAFILE hemf; HRGN hrgn; INT ret; + RECT rc_res, rc_sclip; SetLastError(0xdeadbeef); hdc = CreateEnhMetaFileA(0, NULL, NULL, NULL); @@ -1946,6 +1947,22 @@ static void test_emf_clipping(void) DeleteEnhMetaFile(hemf); ReleaseDC(hwnd, hdc); 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)