reactos/rostests/apitests/gdi32api/tests/GetClipRgn.c
Timo Kreuzer 66397a3a3f - add test for GdiGetCharDimension
- fix a test name
- comment out more tests for EngReleaseSemaphore, they cause heap corruption on ros
- convert more TEST -> RTEST

svn path=/trunk/; revision=33994
2008-06-16 15:24:05 +00:00

32 lines
719 B
C

INT
Test_GetClipRgn(PTESTINFO pti)
{
HWND hWnd;
HDC hDC;
HRGN hrgn;//, hrgn2;
/* Create a window */
hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
NULL, NULL, g_hInstance, 0);
hDC = GetDC(hWnd);
hrgn = CreateRectRgn(0,0,0,0);
/* Test invalid DC */
SetLastError(ERROR_SUCCESS);
RTEST(GetClipRgn((HDC)0x12345, hrgn) == -1);
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
/* Test invalid hrgn */
SetLastError(ERROR_SUCCESS);
RTEST(GetClipRgn(hDC, (HRGN)0x12345) == 0);
RTEST(GetLastError() == ERROR_SUCCESS);
ReleaseDC(hWnd, hDC);
DestroyWindow(hWnd);
return APISTATUS_NORMAL;
}