mirror of
https://github.com/reactos/reactos.git
synced 2024-08-28 14:18:41 +00:00
29 lines
1 KiB
C
29 lines
1 KiB
C
#line 1 "GetStockObject.c"
|
|
|
|
#include "..\gditest.h"
|
|
|
|
BOOL Test_GetStockObject(INT* passed, INT* failed)
|
|
{
|
|
/* Test limits and error */
|
|
SetLastError(ERROR_SUCCESS);
|
|
TEST(GetStockObject(0) != NULL);
|
|
TEST(GetStockObject(21) != NULL);
|
|
TEST(GetStockObject(-1) == NULL);
|
|
TEST(GetStockObject(9) == NULL);
|
|
TEST(GetStockObject(22) == NULL);
|
|
TEST(GetLastError() == ERROR_SUCCESS);
|
|
|
|
/* Test for the stock bit */
|
|
TEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK);
|
|
|
|
/* Test for correct types */
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH);
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH);
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN);
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN);
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT);
|
|
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE);
|
|
|
|
return TRUE;
|
|
}
|