gdi32/tests: Fix pen tests compilation with __WINESRC__ defined.

This commit is contained in:
Dmitry Timoshkov 2013-10-16 14:31:49 +09:00 committed by Alexandre Julliard
parent 0c63f40bdc
commit f81c2e1caf
1 changed files with 23 additions and 23 deletions

View File

@ -95,7 +95,7 @@ static void test_logpen(void)
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp), &lp); size = GetObjectW(hpen, sizeof(lp), &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
@ -114,30 +114,30 @@ static void test_logpen(void)
ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type);
/* check what's the real size of the object */ /* check what's the real size of the object */
size = GetObject(hpen, 0, NULL); size = GetObjectW(hpen, 0, NULL);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
/* ask for truncated data */ /* ask for truncated data */
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp.lopnStyle), &lp); size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
/* see how larger buffer sizes are handled */ /* see how larger buffer sizes are handled */
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp) * 4, &lp); size = GetObjectW(hpen, sizeof(lp) * 4, &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
/* see how larger buffer sizes are handled */ /* see how larger buffer sizes are handled */
memset(&elp, 0xb0, sizeof(elp)); memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp) * 2, &elp); size = GetObjectW(hpen, sizeof(elp) * 2, &elp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp), &lp); size = GetObjectW(hpen, sizeof(lp), &lp);
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
@ -147,7 +147,7 @@ static void test_logpen(void)
memset(&elp, 0xb0, sizeof(elp)); memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp), &elp); size = GetObjectW(hpen, sizeof(elp), &elp);
/* for some reason XP differentiates PS_NULL here */ /* for some reason XP differentiates PS_NULL here */
if (pen[i].style == PS_NULL) if (pen[i].style == PS_NULL)
@ -231,7 +231,7 @@ static void test_logpen(void)
/* check what's the real size of the object */ /* check what's the real size of the object */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, 0, NULL); size = GetObjectW(hpen, 0, NULL);
switch (pen[i].style) switch (pen[i].style)
{ {
case PS_NULL: case PS_NULL:
@ -253,13 +253,13 @@ static void test_logpen(void)
/* ask for truncated data */ /* ask for truncated data */
memset(&elp, 0xb0, sizeof(elp)); memset(&elp, 0xb0, sizeof(elp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp.elpPenStyle), &elp); size = GetObjectW(hpen, sizeof(elp.elpPenStyle), &elp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
/* see how larger buffer sizes are handled */ /* see how larger buffer sizes are handled */
memset(elp_buffer, 0xb0, sizeof(elp_buffer)); memset(elp_buffer, 0xb0, sizeof(elp_buffer));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp_buffer), elp_buffer); size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer);
switch (pen[i].style) switch (pen[i].style)
{ {
case PS_NULL: case PS_NULL:
@ -275,7 +275,7 @@ static void test_logpen(void)
memset(&elp, 0xb0, sizeof(elp)); memset(&elp, 0xb0, sizeof(elp));
memset(&unset_hatch, 0xb0, sizeof(unset_hatch)); memset(&unset_hatch, 0xb0, sizeof(unset_hatch));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp), &elp); size = GetObjectW(hpen, sizeof(elp), &elp);
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch);
@ -341,7 +341,7 @@ test_geometric_pens:
ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type); ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type);
/* check what's the real size of the object */ /* check what's the real size of the object */
size = GetObject(hpen, 0, NULL); size = GetObjectW(hpen, 0, NULL);
switch (pen[i].style) switch (pen[i].style)
{ {
case PS_NULL: case PS_NULL:
@ -363,12 +363,12 @@ test_geometric_pens:
/* ask for truncated data */ /* ask for truncated data */
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp.lopnStyle), &lp); size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp);
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
memset(&lp, 0xb0, sizeof(lp)); memset(&lp, 0xb0, sizeof(lp));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(lp), &lp); size = GetObjectW(hpen, sizeof(lp), &lp);
/* for some reason XP differentiates PS_NULL here */ /* for some reason XP differentiates PS_NULL here */
if (pen[i].style == PS_NULL) if (pen[i].style == PS_NULL)
{ {
@ -386,7 +386,7 @@ test_geometric_pens:
memset(elp_buffer, 0xb0, sizeof(elp_buffer)); memset(elp_buffer, 0xb0, sizeof(elp_buffer));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
/* buffer is too small for user styles */ /* buffer is too small for user styles */
size = GetObject(hpen, offsetof(EXTLOGPEN, elpStyleEntry[1]), elp_buffer); size = GetObjectW(hpen, offsetof(EXTLOGPEN, elpStyleEntry[1]), elp_buffer);
switch (pen[i].style) switch (pen[i].style)
{ {
case PS_NULL: case PS_NULL:
@ -397,7 +397,7 @@ test_geometric_pens:
/* for PS_NULL it also works this way */ /* for PS_NULL it also works this way */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
size = GetObject(hpen, sizeof(elp_buffer), &lp); size = GetObjectW(hpen, sizeof(elp_buffer), &lp);
ok(size == sizeof(LOGPEN), ok(size == sizeof(LOGPEN),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
@ -409,7 +409,7 @@ test_geometric_pens:
case PS_USERSTYLE: case PS_USERSTYLE:
ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/, ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/,
"GetObject should fail: size %d, error %d\n", size, GetLastError()); "GetObject should fail: size %d, error %d\n", size, GetLastError());
size = GetObject(hpen, sizeof(elp_buffer), elp_buffer); size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer);
ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
@ -558,7 +558,7 @@ static void test_ps_userstyle(void)
pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 16, style); pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 16, style);
ok(pen != 0, "ExtCreatePen should not fail\n"); ok(pen != 0, "ExtCreatePen should not fail\n");
size = GetObject(pen, sizeof(buffer), ext_pen); size = GetObjectW(pen, sizeof(buffer), ext_pen);
ok(size == offsetof(EXTLOGPEN, elpStyleEntry[16]), "wrong size %d\n", size); ok(size == offsetof(EXTLOGPEN, elpStyleEntry[16]), "wrong size %d\n", size);
for(i = 0; i < 16; i++) for(i = 0; i < 16; i++)
@ -601,7 +601,7 @@ static void test_brush_pens(void)
lb.lbHatch = HS_CROSS; lb.lbHatch = HS_CROSS;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
size = GetObject( pen, sizeof(buffer), elp ); size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle );
@ -613,7 +613,7 @@ static void test_brush_pens(void)
case BS_NULL: case BS_NULL:
pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL ); pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
size = GetObject( pen, sizeof(buffer), elp ); size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == sizeof(LOGPEN), "wrong size %u\n", size ); ok( size == sizeof(LOGPEN), "wrong size %u\n", size );
ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL, ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL,
"wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle ); "wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle );
@ -626,7 +626,7 @@ static void test_brush_pens(void)
lb.lbHatch = (ULONG_PTR)bmp; lb.lbHatch = (ULONG_PTR)bmp;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
size = GetObject( pen, sizeof(buffer), elp ); size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle );
@ -641,7 +641,7 @@ static void test_brush_pens(void)
lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info; lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info;
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
size = GetObject( pen, sizeof(buffer), elp ); size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle );
@ -667,7 +667,7 @@ static void test_brush_pens(void)
if (lb.lbStyle == BS_SOLID) if (lb.lbStyle == BS_SOLID)
{ {
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
size = GetObject( pen, sizeof(buffer), elp ); size = GetObjectW( pen, sizeof(buffer), elp );
ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle );
ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle );