30#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
31#define expect2(expected, alt, got) ok(got == expected || got == alt, \
32 "Expected %.8x or %.8x, got %.8x\n", expected, alt, got)
45 {
PS_SOLID, -123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
46 {
PS_SOLID, 0,
RGB(0x12,0x34,0x56),
PS_SOLID, 0,
RGB(0x12,0x34,0x56) },
47 {
PS_SOLID, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
48 {
PS_DASH, 123,
RGB(0x12,0x34,0x56),
PS_DASH, 123,
RGB(0x12,0x34,0x56) },
49 {
PS_DOT, 123,
RGB(0x12,0x34,0x56),
PS_DOT, 123,
RGB(0x12,0x34,0x56) },
50 {
PS_DASHDOT, 123,
RGB(0x12,0x34,0x56),
PS_DASHDOT, 123,
RGB(0x12,0x34,0x56) },
51 {
PS_DASHDOTDOT, 123,
RGB(0x12,0x34,0x56),
PS_DASHDOTDOT, 123,
RGB(0x12,0x34,0x56) },
54 {
PS_INSIDEFRAME, 123,
RGB(0x12,0x34,0x56),
PS_INSIDEFRAME, 123,
RGB(0x12,0x34,0x56) },
55 {
PS_USERSTYLE, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
56 {
PS_ALTERNATE, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
57 { 9, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
58 { 10, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
59 { 11, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
60 { 13, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
61 { 14, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
62 { 15, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
70 DWORD obj_type, user_style[2] = { 0xabc, 0xdef };
75 for (
i = 0;
i <
sizeof(pen)/
sizeof(pen[0]);
i++)
94 ok(obj_type ==
OBJ_PEN,
"wrong object type %u\n", obj_type);
96 memset(&lp, 0xb0,
sizeof(lp));
114 ok(obj_type ==
OBJ_PEN,
"wrong object type %u\n", obj_type);
121 memset(&lp, 0xb0,
sizeof(lp));
127 memset(&lp, 0xb0,
sizeof(lp));
133 memset(&elp, 0xb0,
sizeof(elp));
138 memset(&lp, 0xb0,
sizeof(lp));
148 memset(&elp, 0xb0,
sizeof(elp));
160 ok(elp.
elpColor == pen[
i].ret_color,
"expected %08x, got %08x\n", pen[
i].ret_color, elp.
elpColor);
168 memcpy(&lp, &elp,
sizeof(lp));
185 ok(
hpen == 0,
"ExtCreatePen should fail\n");
192 ok(
hpen == 0,
"ExtCreatePen with width != 1 should fail\n");
202 ok(
hpen == 0,
"ExtCreatePen with width != 1 should fail\n");
211 ok(
hpen == 0,
"ExtCreatePen should fail\n");
212 goto test_geometric_pens;
216 ok(
hpen == 0,
"ExtCreatePen should fail\n");
218 goto test_geometric_pens;
226 ok(obj_type ==
OBJ_PEN,
"wrong object type %u\n", obj_type);
230 ok(obj_type ==
OBJ_EXTPEN,
"wrong object type %u\n", obj_type);
254 memset(&elp, 0xb0,
sizeof(elp));
260 memset(elp_buffer, 0xb0,
sizeof(elp_buffer));
268 memcpy(&lp, ext_pen,
sizeof(lp));
275 memset(&elp, 0xb0,
sizeof(elp));
276 memset(&unset_hatch, 0xb0,
sizeof(unset_hatch));
281 ok(ext_pen->
elpHatch == unset_hatch,
"expected 0xb0b0b0b0, got %p\n", (
void *)ext_pen->
elpHatch);
290 ok(ext_style[0] == 0xabc,
"expected 0xabc, got %x\n", ext_style[0]);
291 ok(ext_style[1] == 0xdef,
"expected 0xdef, got %x\n", ext_style[1]);
304 ok(ext_pen->
elpColor == pen[
i].ret_color,
"expected %08x, got %08x\n", pen[
i].ret_color, ext_pen->
elpColor);
318 ok(
hpen == 0,
"ExtCreatePen should fail\n");
325 ok(
hpen == 0,
"ExtCreatePen should fail\n");
330 ok(
hpen == 0,
"ExtCreatePen should fail\n");
339 ok(obj_type ==
OBJ_PEN,
"wrong object type %u\n", obj_type);
341 ok(obj_type ==
OBJ_EXTPEN,
"wrong object type %u\n", obj_type);
364 memset(&lp, 0xb0,
sizeof(lp));
369 memset(&lp, 0xb0,
sizeof(lp));
386 memset(elp_buffer, 0xb0,
sizeof(elp_buffer));
417 ok(ext_style[0] == 0xabc,
"expected 0xabc, got %x\n", ext_style[0]);
418 ok(ext_style[1] == 0xdef,
"expected 0xdef, got %x\n", ext_style[1]);
440 ok(ext_pen->
elpWidth == pen[
i].ret_width,
"expected %u, got %x\n", pen[
i].ret_width, ext_pen->
elpWidth);
441 ok(ext_pen->
elpColor == pen[
i].ret_color,
"expected %08x, got %08x\n", pen[
i].ret_color, ext_pen->
elpColor);
450 unsigned int ret = 0;
451 while(*
s)
ret = (
ret << 1) | (*
s++ ==
'1');
455#define TEST_LINE(x1, x2, z) \
457 SetBitmapBits(bmp, sizeof(buf), &buf); \
458 MoveToEx(hdc, x1, 0, NULL); \
459 LineTo(hdc, x2, 0); \
460 GetBitmapBits(bmp, sizeof(buf), &buf); \
461 expect(atoi2(z), buf); }
478 skip(
"looks like 9x, skipping PS_ALTERNATE tests\n");
508 static DWORD style[17] = {0, 2, 0, 4, 5, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 17};
509 static DWORD bad_style[5] = {0, 0, 0, 0, 0};
510 static DWORD bad_style2[5] = {4, 7, 8, 3, -1};
523 ok(pen == 0,
"ExtCreatePen should fail\n");
529 ok(pen == 0,
"ExtCreatePen should fail\n");
535 ok(pen == 0,
"ExtCreatePen should fail\n");
541 ok(pen == 0,
"ExtCreatePen should fail\n");
547 ok(pen == 0,
"ExtCreatePen should fail\n");
553 ok(pen == 0,
"ExtCreatePen should fail\n");
559 ok(pen != 0,
"ExtCreatePen should not fail\n");
564 for(
i = 0;
i < 16;
i++)
583 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
584 info->bmiHeader.biWidth = 16;
585 info->bmiHeader.biHeight = 16;
586 info->bmiHeader.biPlanes = 1;
587 info->bmiHeader.biBitCount = 32;
607 ok( elp->elpBrushStyle == lb.
lbStyle,
"wrong brush style %x\n", elp->elpBrushStyle );
608 ok( elp->elpColor ==
RGB(12,34,56),
"wrong color %x\n", elp->elpColor );
609 ok( elp->elpHatch ==
HS_CROSS,
"wrong hatch %lx\n", elp->elpHatch );
610 ok( elp->elpNumEntries == 0,
"wrong entries %x\n", elp->elpNumEntries );
619 "wrong pen style %x\n", ((
LOGPEN *)elp)->lopnStyle );
620 ok( ((
LOGPEN *)elp)->lopnColor == 0,
621 "wrong color %x\n", ((
LOGPEN *)elp)->lopnColor );
632 ok( elp->elpBrushStyle ==
BS_PATTERN,
"wrong brush style %x\n", elp->elpBrushStyle );
633 ok( elp->elpColor == 0,
"wrong color %x\n", elp->elpColor );
634 ok( elp->elpHatch == (
ULONG_PTR)
bmp,
"wrong hatch %lx/%p\n", elp->elpHatch,
bmp );
635 ok( elp->elpNumEntries == 0,
"wrong entries %x\n", elp->elpNumEntries );
647 ok( elp->elpBrushStyle ==
BS_DIBPATTERNPT,
"wrong brush style %x\n", elp->elpBrushStyle );
648 ok( elp->elpColor == 0,
"wrong color %x\n", elp->elpColor );
650 "wrong hatch %lx/%lx\n", elp->elpHatch, lb.
lbHatch );
651 ok( elp->elpNumEntries == 0,
"wrong entries %x\n", elp->elpNumEntries );
656 ok( !pen,
"ExtCreatePen succeeded\n" );
672 ok( elp->elpPenStyle ==
PS_DOT,
"wrong pen style %x\n", elp->elpPenStyle );
673 ok( elp->elpBrushStyle ==
BS_SOLID,
"wrong brush style %x\n", elp->elpBrushStyle );
674 ok( elp->elpColor ==
RGB(12,34,56),
"wrong color %x\n", elp->elpColor );
675 ok( elp->elpHatch ==
HS_CROSS,
"wrong hatch %lx\n", elp->elpHatch );
680 ok( !pen,
"ExtCreatePen succeeded\n" );
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
#define ERROR_INVALID_PARAMETER
GLint GLint GLsizei width
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
#define memcpy(s1, s2, n)
static unsigned int atoi2(const char *s)
static void test_ps_userstyle(void)
static void test_ps_alternate(void)
static void test_logpen(void)
#define expect(expected, got)
#define TEST_LINE(x1, x2, z)
static void test_brush_pens(void)
#define expect2(expected, alt, got)
#define offsetof(TYPE, MEMBER)
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
HPEN WINAPI ExtCreatePen(_In_ DWORD iPenStyle, _In_ DWORD cWidth, _In_ const LOGBRUSH *plbrush, _In_ DWORD cStyle, _In_reads_opt_(cStyle) const DWORD *pstyle)
HPEN WINAPI CreatePenIndirect(_In_ const LOGPEN *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)