mirror of
https://github.com/reactos/reactos.git
synced 2024-08-28 22:28:36 +00:00
![Timo Kreuzer](/assets/img/avatar_default.png)
- Add tests for NtGdiSelectBitmap, NtGdiSelectBrush, NtGdiSelectFont and NtGdiSelectPen svn path=/trunk/; revision=30904
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
INT
|
|
Test_NtGdiSelectFont(PTESTINFO pti)
|
|
{
|
|
HDC hDC;
|
|
HFONT hFont, hOldFont;
|
|
|
|
hDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
|
|
|
hFont = GetStockObject(DEFAULT_GUI_FONT);
|
|
|
|
/* Test NULL DC */
|
|
SetLastError(ERROR_SUCCESS);
|
|
hOldFont = NtGdiSelectFont(NULL, hFont);
|
|
TEST(hOldFont == NULL);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
/* Test invalid DC */
|
|
SetLastError(ERROR_SUCCESS);
|
|
hOldFont = NtGdiSelectFont((HDC)((ULONG_PTR)hDC & 0x0000ffff), hFont);
|
|
TEST(hOldFont == NULL);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
/* Test NULL font */
|
|
SetLastError(ERROR_SUCCESS);
|
|
hOldFont = NtGdiSelectFont(hDC, NULL);
|
|
TEST(hOldFont == NULL);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
/* Test invalid font */
|
|
SetLastError(ERROR_SUCCESS);
|
|
hOldFont = NtGdiSelectFont(hDC, (HFONT)((ULONG_PTR)hFont & 0x0000ffff));
|
|
TEST(hOldFont == NULL);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
SetLastError(ERROR_SUCCESS);
|
|
hOldFont = NtGdiSelectFont(hDC, hFont);
|
|
TEST(hOldFont != NULL);
|
|
hOldFont = NtGdiSelectFont(hDC, hOldFont);
|
|
TEST(hOldFont == hFont);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
|
|
DeleteDC(hDC);
|
|
|
|
return APISTATUS_NORMAL;
|
|
}
|
|
|