mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Add Alex' test for GetObject (word alignment check)
- change TEST macro a little for better output svn path=/trunk/; revision=26588
This commit is contained in:
parent
1b553a5e55
commit
6f233933c1
8 changed files with 34 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
|||
(*passed)++;\
|
||||
} else {\
|
||||
(*failed)++;\
|
||||
printf("Test failed in file %s line %d\n", __FILE__, __LINE__);\
|
||||
printf("Test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
|
||||
};
|
||||
|
||||
#define GDI_HANDLE_INDEX_MASK 0x00003fff // (GDI_HANDLE_COUNT - 1)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "CreateCompatibleDC.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL Test_CreateCompatibleDC(INT* passed, INT* failed)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "CreatePen.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
#line 1 "GetObject.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL
|
||||
Test_General(INT* passed, INT* failed)
|
||||
{
|
||||
struct
|
||||
{
|
||||
LOGBRUSH logbrush;
|
||||
BYTE additional[5];
|
||||
} TestStruct;
|
||||
PLOGBRUSH plogbrush;
|
||||
HBRUSH hBrush;
|
||||
|
||||
/* Test null pointer and invalid handles */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(GetObjectA(0, 0, NULL) == 0);
|
||||
|
@ -41,6 +51,15 @@ Test_General(INT* passed, INT* failed)
|
|||
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
|
||||
TEST(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));
|
||||
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
|
||||
TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
|
||||
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
|
||||
TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -383,7 +402,7 @@ BOOL Test_GetObject(INT* passed, INT* failed)
|
|||
TEST(GetLastError() == ERROR_INVALID_HANDLE);
|
||||
DeleteObject(hRgn);
|
||||
|
||||
Test_Font(passed, failed);
|
||||
// Test_Font(passed, failed);
|
||||
Test_Colorspace(passed, failed);
|
||||
Test_General(passed, failed);
|
||||
Test_Bitmap(passed, failed);
|
||||
|
@ -391,7 +410,7 @@ BOOL Test_GetObject(INT* passed, INT* failed)
|
|||
Test_Palette(passed, failed);
|
||||
Test_Brush(passed, failed);
|
||||
Test_Pen(passed, failed);
|
||||
// Test_ExtPpen(passed, failed); // not implemented yet in ROS
|
||||
// Test_ExtPen(passed, failed); // not implemented yet in ROS
|
||||
Test_MetaDC(passed, failed);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "GetStockObject.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL Test_GetStockObject(INT* passed, INT* failed)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "SelectObject.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL Test_SelectObject(INT* passed, INT* failed)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "SetDCPenColor.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
BOOL Test_SetDCPenColor(INT* passed, INT* failed)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#line 1 "SetSysColors.c"
|
||||
|
||||
#include "..\gditest.h"
|
||||
|
||||
#define NUM_SYSCOLORS 31
|
||||
|
|
Loading…
Reference in a new issue