30#define expect(expected,got) expect_(__LINE__, expected, got)
35#define expect2(expected,alt,got) expect2_(__LINE__, expected, alt, got)
39 "Expected %.08lx or %.08lx, got %.08lx\n",
expected, alt, got);
53 {
PS_SOLID, -123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
54 {
PS_SOLID, 0,
RGB(0x12,0x34,0x56),
PS_SOLID, 0,
RGB(0x12,0x34,0x56) },
55 {
PS_SOLID, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
56 {
PS_DASH, 123,
RGB(0x12,0x34,0x56),
PS_DASH, 123,
RGB(0x12,0x34,0x56) },
57 {
PS_DOT, 123,
RGB(0x12,0x34,0x56),
PS_DOT, 123,
RGB(0x12,0x34,0x56) },
58 {
PS_DASHDOT, 123,
RGB(0x12,0x34,0x56),
PS_DASHDOT, 123,
RGB(0x12,0x34,0x56) },
59 {
PS_DASHDOTDOT, 123,
RGB(0x12,0x34,0x56),
PS_DASHDOTDOT, 123,
RGB(0x12,0x34,0x56) },
62 {
PS_INSIDEFRAME, 123,
RGB(0x12,0x34,0x56),
PS_INSIDEFRAME, 123,
RGB(0x12,0x34,0x56) },
63 {
PS_USERSTYLE, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
64 {
PS_ALTERNATE, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
65 { 9, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
66 { 10, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
67 { 11, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
68 { 13, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
69 { 14, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
70 { 15, 123,
RGB(0x12,0x34,0x56),
PS_SOLID, 123,
RGB(0x12,0x34,0x56) },
78 DWORD obj_type, user_style[2] = { 0xabc, 0xdef };
102 ok(obj_type ==
OBJ_PEN,
"wrong object type %lu\n", obj_type);
104 memset(&lp, 0xb0,
sizeof(lp));
122 ok(obj_type ==
OBJ_PEN,
"wrong object type %lu\n", obj_type);
129 memset(&lp, 0xb0,
sizeof(lp));
135 memset(&lp, 0xb0,
sizeof(lp));
141 memset(&elp, 0xb0,
sizeof(elp));
146 memset(&lp, 0xb0,
sizeof(lp));
156 memset(&elp, 0xb0,
sizeof(elp));
168 ok(elp.
elpColor == pen[
i].ret_color,
"expected %08lx, got %08lx\n", pen[
i].ret_color, elp.
elpColor);
176 memcpy(&lp, &elp,
sizeof(lp));
193 ok(
hpen == 0,
"ExtCreatePen should fail\n");
200 ok(
hpen == 0,
"ExtCreatePen with width != 1 should fail\n");
210 ok(
hpen == 0,
"ExtCreatePen with width != 1 should fail\n");
219 ok(
hpen == 0,
"ExtCreatePen should fail\n");
220 goto test_geometric_pens;
224 ok(
hpen == 0,
"ExtCreatePen should fail\n");
226 goto test_geometric_pens;
234 ok(obj_type ==
OBJ_PEN,
"wrong object type %lu\n", obj_type);
238 ok(obj_type ==
OBJ_EXTPEN,
"wrong object type %lu\n", obj_type);
262 memset(&elp, 0xb0,
sizeof(elp));
268 memset(elp_buffer, 0xb0,
sizeof(elp_buffer));
276 memcpy(&lp, ext_pen,
sizeof(lp));
283 memset(&elp, 0xb0,
sizeof(elp));
284 memset(&unset_hatch, 0xb0,
sizeof(unset_hatch));
289 ok(ext_pen->
elpHatch == unset_hatch,
"expected 0xb0b0b0b0, got %p\n", (
void *)ext_pen->
elpHatch);
298 ok(ext_style[0] == 0xabc,
"expected 0xabc, got %lx\n", ext_style[0]);
299 ok(ext_style[1] == 0xdef,
"expected 0xdef, got %lx\n", ext_style[1]);
312 ok(ext_pen->
elpColor == pen[
i].ret_color,
"expected %08lx, got %08lx\n", pen[
i].ret_color, ext_pen->
elpColor);
326 ok(
hpen == 0,
"ExtCreatePen should fail\n");
333 ok(
hpen == 0,
"ExtCreatePen should fail\n");
338 ok(
hpen == 0,
"ExtCreatePen should fail\n");
347 ok(obj_type ==
OBJ_PEN,
"wrong object type %lu\n", obj_type);
349 ok(obj_type ==
OBJ_EXTPEN,
"wrong object type %lu\n", obj_type);
372 memset(&lp, 0xb0,
sizeof(lp));
377 memset(&lp, 0xb0,
sizeof(lp));
394 memset(elp_buffer, 0xb0,
sizeof(elp_buffer));
425 ok(ext_style[0] == 0xabc,
"expected 0xabc, got %lx\n", ext_style[0]);
426 ok(ext_style[1] == 0xdef,
"expected 0xdef, got %lx\n", ext_style[1]);
448 ok(ext_pen->
elpWidth == pen[
i].ret_width,
"expected %u, got %lx\n", pen[
i].ret_width, ext_pen->
elpWidth);
449 ok(ext_pen->
elpColor == pen[
i].ret_color,
"expected %08lx, got %08lx\n", pen[
i].ret_color, ext_pen->
elpColor);
458 unsigned int ret = 0;
459 while(*
s)
ret = (
ret << 1) | (*
s++ ==
'1');
463#define TEST_LINE(x1, x2, z) \
465 SetBitmapBits(bmp, sizeof(buf), &buf); \
466 MoveToEx(hdc, x1, 0, NULL); \
467 LineTo(hdc, x2, 0); \
468 GetBitmapBits(bmp, sizeof(buf), &buf); \
469 expect(atoi2(z), buf); }
486 skip(
"looks like 9x, skipping PS_ALTERNATE tests\n");
516 static DWORD style[17] = {0, 2, 0, 4, 5, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 17};
517 static DWORD bad_style[5] = {0, 0, 0, 0, 0};
518 static DWORD bad_style2[5] = {4, 7, 8, 3, -1};
531 ok(pen == 0,
"ExtCreatePen should fail\n");
537 ok(pen == 0,
"ExtCreatePen should fail\n");
543 ok(pen == 0,
"ExtCreatePen should fail\n");
549 ok(pen == 0,
"ExtCreatePen should fail\n");
555 ok(pen == 0,
"ExtCreatePen should fail\n");
561 ok(pen == 0,
"ExtCreatePen should fail\n");
567 ok(pen != 0,
"ExtCreatePen should not fail\n");
572 for(
i = 0;
i < 16;
i++)
591 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
592 info->bmiHeader.biWidth = 16;
593 info->bmiHeader.biHeight = 16;
594 info->bmiHeader.biPlanes = 1;
595 info->bmiHeader.biBitCount = 32;
615 ok( elp->elpBrushStyle == lb.
lbStyle,
"wrong brush style %x\n", elp->elpBrushStyle );
616 ok( elp->elpColor ==
RGB(12,34,56),
"wrong color %lx\n", elp->elpColor );
617 ok( elp->elpHatch ==
HS_CROSS,
"wrong hatch %Ix\n", elp->elpHatch );
618 ok( elp->elpNumEntries == 0,
"wrong entries %lx\n", elp->elpNumEntries );
627 "wrong pen style %x\n", ((
LOGPEN *)elp)->lopnStyle );
628 ok( ((
LOGPEN *)elp)->lopnColor == 0,
629 "wrong color %lx\n", ((
LOGPEN *)elp)->lopnColor );
640 ok( elp->elpBrushStyle ==
BS_PATTERN,
"wrong brush style %x\n", elp->elpBrushStyle );
641 ok( elp->elpColor == 0,
"wrong color %lx\n", elp->elpColor );
642 ok( elp->elpHatch == (
ULONG_PTR)
bmp,
"wrong hatch %Ix/%p\n", elp->elpHatch,
bmp );
643 ok( elp->elpNumEntries == 0,
"wrong entries %lx\n", elp->elpNumEntries );
655 ok( elp->elpBrushStyle ==
BS_DIBPATTERNPT,
"wrong brush style %x\n", elp->elpBrushStyle );
656 ok( elp->elpColor == 0,
"wrong color %lx\n", elp->elpColor );
657 ok( elp->elpHatch == lb.
lbHatch,
"wrong hatch %Ix/%Ix\n", elp->elpHatch, lb.
lbHatch );
658 ok( elp->elpNumEntries == 0,
"wrong entries %lx\n", elp->elpNumEntries );
663 ok( !pen,
"ExtCreatePen succeeded\n" );
679 ok( elp->elpPenStyle ==
PS_DOT,
"wrong pen style %lx\n", elp->elpPenStyle );
680 ok( elp->elpBrushStyle ==
BS_SOLID,
"wrong brush style %x\n", elp->elpBrushStyle );
681 ok( elp->elpColor ==
RGB(12,34,56),
"wrong color %lx\n", elp->elpColor );
682 ok( elp->elpHatch ==
HS_CROSS,
"wrong hatch %Ix\n", elp->elpHatch );
687 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
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
static ERESOURCE GlobalLock
#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 expect2_(unsigned line, DWORD expected, DWORD alt, DWORD got)
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 expect_(expected, got, precision)
#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)