mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 13:11:22 +00:00
- 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
This commit is contained in:
parent
aa36da89c9
commit
66397a3a3f
11 changed files with 289 additions and 254 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "tests/GdiConvertPalette.c"
|
||||
#include "tests/GdiConvertRegion.c"
|
||||
#include "tests/GdiDeleteLocalDC.c"
|
||||
#include "tests/GdiGetCharDimensions.c"
|
||||
#include "tests/GdiGetLocalBrush.c"
|
||||
#include "tests/GdiGetLocalDC.c"
|
||||
#include "tests/GdiReleaseLocalDC.c"
|
||||
|
@ -63,11 +64,12 @@ TESTENTRY TestList[] =
|
|||
{ L"ExtCreatePen", Test_ExtCreatePen },
|
||||
{ L"GdiConvertBitmap", Test_GdiConvertBitmap },
|
||||
{ L"GdiConvertBrush", Test_GdiConvertBrush },
|
||||
{ L"GdiConvertBrush", Test_GdiConvertDC },
|
||||
{ L"GdiConvertDC", Test_GdiConvertDC },
|
||||
{ L"GdiConvertFont", Test_GdiConvertFont },
|
||||
{ L"GdiConvertPalette", Test_GdiConvertPalette },
|
||||
{ L"GdiConvertRegion", Test_GdiConvertRegion },
|
||||
{ L"GdiDeleteLocalDC", Test_GdiDeleteLocalDC },
|
||||
{ L"GdiGetCharDimensions", Test_GdiGetCharDimensions },
|
||||
{ L"GdiGetLocalBrush", Test_GdiGetLocalBrush },
|
||||
{ L"GdiGetLocalDC", Test_GdiGetLocalDC },
|
||||
{ L"GdiReleaseLocalDC", Test_GdiReleaseLocalDC },
|
||||
|
|
|
@ -23,39 +23,48 @@ Test_AddFontResourceA(PTESTINFO pti)
|
|||
|
||||
/* Testing NULL pointer */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA(NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(AddFontResourceA(NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing -1 pointer */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA((CHAR*)-1) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(AddFontResourceA((CHAR*)-1) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing address 1 pointer */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA((CHAR*)1) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(AddFontResourceA((CHAR*)1) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing address empty string */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA("") == 0);
|
||||
RTEST(AddFontResourceA("") == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
/* Testing one ttf font */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA(szFileNameFont1A) == 1);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing one otf font */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceA(szFileNameFont2A) == 1);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing two fonts */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
sprintf(szFileNameA,"%s|%s",szFileNameFont1A, szFileNameFont2A);
|
||||
TEST(AddFontResourceA(szFileNameA) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
sprintf(szFileNameA,"%s |%s",szFileNameFont1A, szFileNameFont2A);
|
||||
TEST(AddFontResourceA(szFileNameA) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Testing two font */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
sprintf(szFileNameA,"%s | %s",szFileNameFont1A, szFileNameFont2A);
|
||||
TEST(AddFontResourceA(szFileNameA) == 0);
|
||||
printf("%x\n",(INT)GetLastError());
|
||||
TEST(GetLastError() == ERROR_FILE_NOT_FOUND);
|
||||
|
||||
return APISTATUS_NORMAL;
|
||||
|
|
|
@ -13,7 +13,7 @@ Test_AddFontResourceEx(PTESTINFO pti)
|
|||
|
||||
/* Test "" filename */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceExW(L"", 0, 0) == 0);
|
||||
RTEST(AddFontResourceExW(L"", 0, 0) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
GetEnvironmentVariableW(L"systemroot", szFileName, MAX_PATH);
|
||||
|
@ -22,11 +22,11 @@ Test_AddFontResourceEx(PTESTINFO pti)
|
|||
/* Test flags = 0 */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceExW(szFileName, 0, 0) != 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(AddFontResourceExW(szFileName, 256, 0) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(AddFontResourceExW(szFileName, 256, 0) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
/* Test invalid pointer as last parameter */
|
||||
TEST(AddFontResourceExW(szFileName, 0, (void*)-1) != 0);
|
||||
|
|
|
@ -29,12 +29,12 @@ Test_EngReleaseSemaphore(PTESTINFO pti)
|
|||
EngDeleteSemaphore(hsem);
|
||||
|
||||
/* try with deleted Semaphore */
|
||||
EngReleaseSemaphore(hsem);
|
||||
// EngReleaseSemaphore(hsem); -> this leads to heap correuption
|
||||
// RTEST (lpcrit->LockCount > 0);
|
||||
RTEST (lpcrit->RecursionCount != 0);
|
||||
RTEST (lpcrit->OwningThread == 0);
|
||||
RTEST (lpcrit->LockSemaphore == 0);
|
||||
RTEST (lpcrit->SpinCount == 0);
|
||||
// RTEST (lpcrit->RecursionCount != 0);
|
||||
// RTEST (lpcrit->OwningThread == 0);
|
||||
// RTEST (lpcrit->LockSemaphore == 0);
|
||||
// RTEST (lpcrit->SpinCount == 0);
|
||||
|
||||
// ASSERT(lpcrit->DebugInfo != NULL);
|
||||
// RTEST (lpcrit->DebugInfo->Type != 0);
|
||||
|
|
27
rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c
Normal file
27
rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
LONG STDCALL GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *);
|
||||
|
||||
INT
|
||||
Test_GdiGetCharDimensions(PTESTINFO pti)
|
||||
{
|
||||
LOGFONT logfont = {-11, 0, 0, 0, 400,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
"MS Shell Dlg 2"};
|
||||
HFONT hFont, hOldFont;
|
||||
HDC hDC;
|
||||
LONG x,y;
|
||||
TEXTMETRICW tm;
|
||||
|
||||
hFont = CreateFontIndirect(&logfont);
|
||||
hDC = CreateCompatibleDC(NULL);
|
||||
hOldFont = SelectObject(hDC, hFont);
|
||||
|
||||
x = GdiGetCharDimensions(hDC, &tm, &y);
|
||||
|
||||
RTEST(y == tm.tmHeight);
|
||||
|
||||
SelectObject(hDC, hOldFont);
|
||||
DeleteObject(hFont);
|
||||
DeleteDC(hDC);
|
||||
|
||||
return APISTATUS_NORMAL;
|
||||
}
|
|
@ -15,13 +15,13 @@ Test_GetClipRgn(PTESTINFO pti)
|
|||
|
||||
/* Test invalid DC */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetClipRgn((HDC)0x12345, hrgn) == -1);
|
||||
RTEST(GetClipRgn((HDC)0x12345, hrgn) == -1);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
/* Test invalid hrgn */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetClipRgn(hDC, (HRGN)0x12345) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetClipRgn(hDC, (HRGN)0x12345) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
ReleaseDC(hWnd, hDC);
|
||||
DestroyWindow(hWnd);
|
||||
|
|
|
@ -14,122 +14,122 @@ Test_GetCurrentObject(PTESTINFO pti)
|
|||
|
||||
/* Test NULL DC */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(NULL, 0) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject(NULL, 0) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(NULL, OBJ_BITMAP) == 0);
|
||||
TEST(GetCurrentObject(NULL, OBJ_BRUSH) == 0);
|
||||
TEST(GetCurrentObject(NULL, OBJ_COLORSPACE) == 0);
|
||||
TEST(GetCurrentObject(NULL, OBJ_FONT) == 0);
|
||||
TEST(GetCurrentObject(NULL, OBJ_PAL) == 0);
|
||||
TEST(GetCurrentObject(NULL, OBJ_PEN) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_BITMAP) == 0);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_BRUSH) == 0);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_COLORSPACE) == 0);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_FONT) == 0);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_PAL) == 0);
|
||||
RTEST(GetCurrentObject(NULL, OBJ_PEN) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Test invalid DC handle */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject((HDC)-123, 0) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject((HDC)-123, 0) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject((HDC)-123, OBJ_BITMAP) == 0);
|
||||
RTEST(GetCurrentObject((HDC)-123, OBJ_BITMAP) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Test invalid types */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 0) == 0);
|
||||
RTEST(GetCurrentObject(hDC, 0) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, 3) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, 4) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, 8) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 3) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject(hDC, 9) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 4) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject(hDC, 10) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 8) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject(hDC, 12) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 9) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 10) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 12) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, 13) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetCurrentObject(hDC, 13) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
/* Default bitmap */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
HBITMAP hBmp;
|
||||
hBmp = GetCurrentObject(hDC, OBJ_BITMAP);
|
||||
TEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Other bitmap */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
SelectObject(hDC, GetStockObject(21));
|
||||
TEST(hBmp == GetCurrentObject(hDC, OBJ_BITMAP));
|
||||
TEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(hBmp == GetCurrentObject(hDC, OBJ_BITMAP));
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Default brush */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(WHITE_BRUSH));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Other brush */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
SelectObject(hDC, GetStockObject(BLACK_BRUSH));
|
||||
TEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(BLACK_BRUSH));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(BLACK_BRUSH));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Default colorspace */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, OBJ_COLORSPACE) == GetStockObject(20));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_COLORSPACE) == GetStockObject(20));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Default font */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(SYSTEM_FONT));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(SYSTEM_FONT));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Other font */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT));
|
||||
TEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(DEFAULT_GUI_FONT));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(DEFAULT_GUI_FONT));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Default palette */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, OBJ_PAL) == GetStockObject(DEFAULT_PALETTE));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_PAL) == GetStockObject(DEFAULT_PALETTE));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Default pen */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(BLACK_PEN));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(BLACK_PEN));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Other pen */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
SelectObject(hDC, GetStockObject(WHITE_PEN));
|
||||
TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(WHITE_PEN));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(WHITE_PEN));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* DC pen */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
SelectObject(hDC, GetStockObject(DC_PEN));
|
||||
TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(DC_PEN));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(DC_PEN));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
ReleaseDC(hWnd, hDC);
|
||||
DestroyWindow(hWnd);
|
||||
|
|
|
@ -11,50 +11,50 @@ Test_General(PTESTINFO pti)
|
|||
|
||||
/* Test null pointer and invalid handles */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA(0, 0, NULL) == 0);
|
||||
TEST(GetObjectA((HANDLE)-1, 0, NULL) == 0);
|
||||
TEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetObjectA(0, 0, NULL) == 0);
|
||||
RTEST(GetObjectA((HANDLE)-1, 0, NULL) == 0);
|
||||
RTEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
|
||||
/* Test need of alignment */
|
||||
hBrush = GetStockObject(WHITE_BRUSH);
|
||||
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush);
|
||||
TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
|
||||
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
|
||||
TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
|
||||
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
|
||||
TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0);
|
||||
RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -73,21 +73,21 @@ Test_Bitmap(PTESTINFO pti)
|
|||
if (!hBitmap) return FALSE;
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, 0, Buffer) == 0);
|
||||
TEST(GetObjectA(hBitmap, 5, Buffer) == 0);
|
||||
TEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP));
|
||||
TEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, 0, Buffer) == 0);
|
||||
RTEST(GetObjectA(hBitmap, 5, Buffer) == 0);
|
||||
RTEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP));
|
||||
RTEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
// todo: test invalid handle + buffer
|
||||
|
||||
|
@ -109,18 +109,18 @@ Test_Dibsection(PTESTINFO pti)
|
|||
if(!hBitmap) return FALSE;
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, 0, &dibsection) == 0);
|
||||
TEST(GetObject(hBitmap, 5, &dibsection) == 0);
|
||||
TEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP));
|
||||
TEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION));
|
||||
TEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION));
|
||||
TEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, 0, &dibsection) == 0);
|
||||
RTEST(GetObject(hBitmap, 5, &dibsection) == 0);
|
||||
RTEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP));
|
||||
RTEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION));
|
||||
RTEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION));
|
||||
RTEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
DeleteObject(hBitmap);
|
||||
ReleaseDC(0, hDC);
|
||||
|
||||
|
@ -145,18 +145,18 @@ Test_Palette(PTESTINFO pti)
|
|||
if (!hPalette) return FALSE;
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, 0, NULL) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, 5, NULL) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, -5, NULL) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD));
|
||||
TEST(GetObject(hPalette, 0, &wPalette) == 0);
|
||||
TEST(GetObject(hPalette, 1, &wPalette) == 0);
|
||||
TEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD));
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, 0, NULL) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, 5, NULL) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, -5, NULL) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD));
|
||||
RTEST(GetObject(hPalette, 0, &wPalette) == 0);
|
||||
RTEST(GetObject(hPalette, 1, &wPalette) == 0);
|
||||
RTEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
DeleteObject(hPalette);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -172,10 +172,10 @@ Test_Brush(PTESTINFO pti)
|
|||
if (!hBrush) return FALSE;
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
|
||||
TEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH));
|
||||
TEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH));
|
||||
RTEST(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH));
|
||||
|
||||
|
@ -311,38 +311,38 @@ Test_Font(PTESTINFO pti)
|
|||
hFont = CreateFontA(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
|
||||
ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS,
|
||||
ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont");
|
||||
TEST(hFont);
|
||||
RTEST(hFont);
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA));
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW));
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); // 60
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA)); // 156
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA)); // 188
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA)); // 192
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA)); // 260
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA)); // 260
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); // 92
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW)); // 284
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW)); // 320
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW)); // 348
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW)); // 420
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW)); // 356!
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA));
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW));
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); // 60
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA)); // 156
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA)); // 188
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA)); // 192
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA)); // 260
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA)); // 260
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); // 92
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW)); // 284
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW)); // 320
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW)); // 348
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW)); // 420
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW)); // 356!
|
||||
|
||||
TEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA));
|
||||
TEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA));
|
||||
TEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA));
|
||||
TEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA));
|
||||
TEST(GetObjectA(hFont, 0, &logfonta) == 0);
|
||||
TEST(logfonta.lfHeight == 0x77777777);
|
||||
RTEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA));
|
||||
RTEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA));
|
||||
RTEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA));
|
||||
RTEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA));
|
||||
RTEST(GetObjectA(hFont, 0, &logfonta) == 0);
|
||||
RTEST(logfonta.lfHeight == 0x77777777);
|
||||
|
||||
TEST(GetObjectA(hFont, 5, &logfonta) == 5);
|
||||
TEST(logfonta.lfHeight == 8);
|
||||
TEST(logfonta.lfWidth == 0x77777708);
|
||||
|
||||
TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
|
||||
RTEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
|
||||
TEST(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA)); // 92
|
||||
TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192
|
||||
RTEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192
|
||||
TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1); // 192
|
||||
TEST(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA)); // 320
|
||||
|
||||
|
@ -351,29 +351,29 @@ Test_Font(PTESTINFO pti)
|
|||
/* LOGFONT / GetObjectW */
|
||||
FillMemory(&logfontw, sizeof(LOGFONTW), 0x77);
|
||||
|
||||
TEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW));
|
||||
TEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW));
|
||||
TEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW));
|
||||
TEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW));
|
||||
TEST(GetObjectW(hFont, 0, &logfontw) == 0);
|
||||
TEST(logfontw.lfHeight == 0x77777777);
|
||||
RTEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW));
|
||||
RTEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW));
|
||||
RTEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW));
|
||||
RTEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW));
|
||||
RTEST(GetObjectW(hFont, 0, &logfontw) == 0);
|
||||
RTEST(logfontw.lfHeight == 0x77777777);
|
||||
|
||||
TEST(GetObjectW(hFont, 5, &logfontw) == 5);
|
||||
TEST(logfontw.lfHeight == 8);
|
||||
TEST(logfontw.lfWidth == 0x77777708);
|
||||
|
||||
TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
|
||||
TEST(logfonta.lfHeight == 8);
|
||||
TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA)); // 156
|
||||
TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA)); // 188
|
||||
TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192
|
||||
TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260
|
||||
RTEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
|
||||
RTEST(logfonta.lfHeight == 8);
|
||||
RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA)); // 156
|
||||
RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA)); // 188
|
||||
RTEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192
|
||||
RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260
|
||||
TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260
|
||||
|
||||
TEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92
|
||||
TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW)); // 284
|
||||
TEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW)); // 320
|
||||
TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW)); // 348
|
||||
RTEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92
|
||||
RTEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW)); // 284
|
||||
RTEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW)); // 320
|
||||
RTEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW)); // 348
|
||||
TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 420
|
||||
TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 356!
|
||||
|
||||
|
@ -392,7 +392,7 @@ Test_Colorspace(PTESTINFO pti)
|
|||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60);// FIXME: what structure?
|
||||
TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0);
|
||||
RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER);
|
||||
|
||||
return TRUE;
|
||||
|
@ -410,11 +410,11 @@ Test_MetaDC(PTESTINFO pti)
|
|||
if(((UINT)hMetaDC & GDI_HANDLE_TYPE_MASK) != GDI_OBJECT_TYPE_METADC) return FALSE;
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0);
|
||||
TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0);
|
||||
TEST(GetObjectA(hMetaDC, 0, NULL) == 0);
|
||||
TEST(GetObjectA(hMetaDC, 100, &buffer) == 0);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0);
|
||||
RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0);
|
||||
RTEST(GetObjectA(hMetaDC, 0, NULL) == 0);
|
||||
RTEST(GetObjectA(hMetaDC, 100, &buffer) == 0);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -425,8 +425,8 @@ Test_GetObject(PTESTINFO pti)
|
|||
HRGN hRgn;
|
||||
hRgn = CreateRectRgn(0,0,5,5);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectW(hRgn, 0, NULL) == 0);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(GetObjectW(hRgn, 0, NULL) == 0);
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
DeleteObject(hRgn);
|
||||
|
||||
Test_Font(pti);
|
||||
|
|
|
@ -5,7 +5,7 @@ Test_GetStockObject(PTESTINFO pti)
|
|||
SetLastError(ERROR_SUCCESS);
|
||||
RTEST(GetStockObject(0) != NULL);
|
||||
TEST(GetStockObject(20) != NULL);
|
||||
TEST(GetStockObject(21) != NULL);
|
||||
RTEST(GetStockObject(21) != NULL);
|
||||
RTEST(GetStockObject(-1) == NULL);
|
||||
RTEST(GetStockObject(9) == NULL);
|
||||
RTEST(GetStockObject(22) == NULL);
|
||||
|
@ -15,27 +15,27 @@ Test_GetStockObject(PTESTINFO pti)
|
|||
RTEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK);
|
||||
|
||||
/* Test for correct types */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); /* 12 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(20)) == GDI_OBJECT_TYPE_COLORSPACE); /* 20 */
|
||||
TEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */
|
||||
RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */
|
||||
|
||||
return APISTATUS_NORMAL;
|
||||
}
|
||||
|
|
|
@ -23,16 +23,16 @@ Test_SelectObject(PTESTINFO pti)
|
|||
SetLastError(ERROR_SUCCESS);
|
||||
hNewObj = GetStockObject(GRAY_BRUSH);
|
||||
hOldObj = SelectObject((HDC)GDI_HANDLE_GET_INDEX(hDC), hNewObj);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
TEST(hOldObj == NULL);
|
||||
TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(hOldObj == NULL);
|
||||
RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
/* Test incomplete hobj handle works */
|
||||
hNewObj = GetStockObject(GRAY_BRUSH);
|
||||
hOldObj = SelectObject(hDC, (HGDIOBJ)GDI_HANDLE_GET_INDEX(hNewObj));
|
||||
TEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
TEST(pDc_Attr->hbrush == hNewObj);
|
||||
RTEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(pDc_Attr->hbrush == hNewObj);
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
/* Test wrong hDC handle type */
|
||||
|
@ -41,9 +41,9 @@ Test_SelectObject(PTESTINFO pti)
|
|||
hDC2 = (HDC)((UINT_PTR)hDC & ~GDI_HANDLE_TYPE_MASK);
|
||||
hDC2 = (HDC)((UINT_PTR)hDC2 | GDI_OBJECT_TYPE_PEN);
|
||||
hOldObj = SelectObject(hDC2, hNewObj);
|
||||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
TEST(hOldObj == NULL);
|
||||
TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
RTEST(hOldObj == NULL);
|
||||
RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
|
||||
/* Test wrong hobj handle type */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
|
@ -51,46 +51,46 @@ Test_SelectObject(PTESTINFO pti)
|
|||
hNewObj = (HGDIOBJ)((UINT_PTR)hNewObj & ~GDI_HANDLE_TYPE_MASK);
|
||||
hNewObj = (HGDIOBJ)((UINT_PTR)hNewObj | GDI_OBJECT_TYPE_PEN);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
TEST(hOldObj == NULL);
|
||||
TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(hOldObj == NULL);
|
||||
RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH));
|
||||
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
hNewObj = (HGDIOBJ)0x00761234;
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(hOldObj == NULL);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(hOldObj == NULL);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
/* Test DC */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
hOldObj = SelectObject(hDC, hScreenDC);
|
||||
TEST(hOldObj == NULL);
|
||||
RTEST(hOldObj == NULL);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Test REGION */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
hNewObj = CreateRectRgn(0,0,0,0);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST((UINT_PTR)hOldObj == NULLREGION);
|
||||
RTEST((UINT_PTR)hOldObj == NULLREGION);
|
||||
DeleteObject(hNewObj);
|
||||
|
||||
hNewObj = CreateRectRgn(0,0,10,10);
|
||||
TEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION);
|
||||
RTEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION);
|
||||
hOldObj = CreateRectRgn(5,5,20,20);
|
||||
TEST(CombineRgn(hNewObj, hNewObj, hOldObj, RGN_OR) == COMPLEXREGION);
|
||||
RTEST(CombineRgn(hNewObj, hNewObj, hOldObj, RGN_OR) == COMPLEXREGION);
|
||||
DeleteObject(hOldObj);
|
||||
TEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); // ??? Why this?
|
||||
RTEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); // ??? Why this?
|
||||
DeleteObject(hNewObj);
|
||||
TEST(GetLastError() == ERROR_SUCCESS);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
||||
/* Test BITMAP */
|
||||
hNewObj = CreateBitmap(2, 2, 1, 1, &bmBits);
|
||||
ASSERT(hNewObj != NULL);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BITMAP);
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BITMAP);
|
||||
hOldObj = SelectObject(hDC, hOldObj);
|
||||
TEST(hOldObj == hNewObj);
|
||||
RTEST(hOldObj == hNewObj);
|
||||
|
||||
/* Test CLIOBJ */
|
||||
|
||||
|
@ -100,8 +100,8 @@ Test_SelectObject(PTESTINFO pti)
|
|||
SetLastError(ERROR_SUCCESS);
|
||||
hNewObj = GetStockObject(DEFAULT_PALETTE);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(hOldObj == NULL);
|
||||
TEST(GetLastError() == ERROR_INVALID_FUNCTION);
|
||||
RTEST(hOldObj == NULL);
|
||||
RTEST(GetLastError() == ERROR_INVALID_FUNCTION);
|
||||
|
||||
/* Test COLORSPACE */
|
||||
|
||||
|
@ -112,15 +112,15 @@ Test_SelectObject(PTESTINFO pti)
|
|||
/* Test BRUSH */
|
||||
hNewObj = GetStockObject(GRAY_BRUSH);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
TEST(pDc_Attr->hbrush == hNewObj);
|
||||
TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH);
|
||||
RTEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(pDc_Attr->hbrush == hNewObj);
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH);
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
/* Test DC_BRUSH */
|
||||
hNewObj = GetStockObject(DC_BRUSH);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(pDc_Attr->hbrush == hNewObj);
|
||||
RTEST(pDc_Attr->hbrush == hNewObj);
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
/* Test BRUSH color xform */
|
||||
|
@ -136,9 +136,9 @@ Test_SelectObject(PTESTINFO pti)
|
|||
/* Test PEN */
|
||||
hNewObj = GetStockObject(GRAY_BRUSH);
|
||||
hOldObj = SelectObject(hDC, hNewObj);
|
||||
TEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
TEST(pDc_Attr->hbrush == hNewObj);
|
||||
TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH);
|
||||
RTEST(hOldObj == GetStockObject(WHITE_BRUSH));
|
||||
RTEST(pDc_Attr->hbrush == hNewObj);
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH);
|
||||
SelectObject(hDC, hOldObj);
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ Test_SetDCPenColor(PTESTINFO pti)
|
|||
// Test an incorrect DC
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
RTEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID);
|
||||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
RTEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
// Get the Screen DC
|
||||
hScreenDC = GetDC(NULL);
|
||||
|
@ -14,23 +14,20 @@ Test_SetDCPenColor(PTESTINFO pti)
|
|||
|
||||
// Test the screen DC
|
||||
SetDCPenColor(hScreenDC, RGB(1,2,3));
|
||||
TEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3));
|
||||
RTEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3));
|
||||
|
||||
// Create a new DC
|
||||
hDC = CreateCompatibleDC(hScreenDC);
|
||||
ReleaseDC(0, hScreenDC);
|
||||
if (hDC == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
ASSERT(hDC);
|
||||
|
||||
// Select the DC_PEN and check if the pen returned by a new call is DC_PEN
|
||||
SelectObject(hDC, GetStockObject(DC_PEN));
|
||||
TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
|
||||
RTEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
|
||||
|
||||
// Test an incorrect color, yes windows sets the color!
|
||||
SetDCPenColor(hDC, 0x21123456);
|
||||
TEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456);
|
||||
RTEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456);
|
||||
|
||||
// Test CLR_INVALID, it sets CLR_INVALID!
|
||||
SetDCPenColor(hDC, CLR_INVALID);
|
||||
|
|
Loading…
Reference in a new issue