reactos/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c
Timo Kreuzer 2b31cf640d - Add test for AddFontResourceEx showing that the function accepts 0 as flags.
- remove header inclusion in test files

svn path=/trunk/; revision=28753
2007-09-01 22:06:05 +00:00

36 lines
878 B
C

INT
Test_CreateCompatibleDC(PTESTINFO pti)
{
HDC hDCScreen, hOldDC, hDC, hDC2;
// Create a DC
hDCScreen = GetDC(NULL);
if (hDCScreen == NULL)
{
return FALSE;
}
hDC = CreateCompatibleDC(hDCScreen);
RTEST(hDC != NULL);
// Test if first selected pen is BLACK_PEN (? or same as screen DC's pen?)
TEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN));
TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
// Test for the starting Color == RGB(0,0,0)
TEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0));
// Check for reuse counter
hOldDC = hDC;
DeleteDC(hDC);
hDC = CreateCompatibleDC(hDCScreen);
hDC2 = CreateCompatibleDC(hOldDC);
RTEST(hDC2 == NULL);
if (hDC2 != NULL) DeleteDC(hDC2);
// cleanup
DeleteDC(hDC);
ReleaseDC(NULL, hDCScreen);
return APISTATUS_NORMAL;
}