Commit 5a672270 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32/tests: Get rid of Win9x compatibility in the pen tests.

parent eaa8801d
...@@ -98,19 +98,9 @@ static void test_logpen(void) ...@@ -98,19 +98,9 @@ static void test_logpen(void)
size = GetObject(hpen, sizeof(lp), &lp); size = GetObject(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());
if (pen[i].style == PS_USERSTYLE || pen[i].style == PS_ALTERNATE)
{
if (lp.lopnStyle == pen[i].style)
{
win_skip("Skipping PS_USERSTYLE and PS_ALTERNATE tests on Win9x\n");
continue;
}
}
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);
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x); ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0 || ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
broken(lp.lopnWidth.y == 0xb), /* Win9x */
"expected 0, got %d\n", lp.lopnWidth.y);
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor); ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
DeleteObject(hpen); DeleteObject(hpen);
...@@ -131,9 +121,7 @@ static void test_logpen(void) ...@@ -131,9 +121,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.lopnStyle), &lp); size = GetObject(hpen, sizeof(lp.lopnStyle), &lp);
ok(!size || ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
broken(size == sizeof(lp.lopnStyle)), /* Win9x */
"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));
...@@ -251,17 +239,12 @@ static void test_logpen(void) ...@@ -251,17 +239,12 @@ static void test_logpen(void)
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style) || ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
broken(size == 0 && GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
default: default:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) || ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
broken(size == sizeof(LOGPEN)) || /* Win9x */
broken(pen[i].style == PS_ALTERNATE &&
size == 0 &&
GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
} }
...@@ -270,9 +253,7 @@ static void test_logpen(void) ...@@ -270,9 +253,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.elpPenStyle), &elp); size = GetObject(hpen, sizeof(elp.elpPenStyle), &elp);
ok(!size || ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
broken(size == sizeof(elp.elpPenStyle)), /* Win9x */
"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));
...@@ -301,7 +282,7 @@ static void test_logpen(void) ...@@ -301,7 +282,7 @@ static void test_logpen(void)
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style), ok(size == FIELD_OFFSET( 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);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
...@@ -310,11 +291,7 @@ static void test_logpen(void) ...@@ -310,11 +291,7 @@ static void test_logpen(void)
break; break;
default: default:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) || ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
broken(size == sizeof(LOGPEN)) || /* Win9x */
broken(pen[i].style == PS_ALTERNATE &&
size == 0 &&
GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
"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);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
...@@ -372,12 +349,12 @@ test_geometric_pens: ...@@ -372,12 +349,12 @@ test_geometric_pens:
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style), ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
default: default:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry), ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
} }
...@@ -432,7 +409,7 @@ test_geometric_pens: ...@@ -432,7 +409,7 @@ test_geometric_pens:
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 = GetObject(hpen, sizeof(elp_buffer), elp_buffer);
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style), ok(size == FIELD_OFFSET( 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);
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
...@@ -441,7 +418,7 @@ test_geometric_pens: ...@@ -441,7 +418,7 @@ test_geometric_pens:
break; break;
default: default:
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry), ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
"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);
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
...@@ -547,11 +524,6 @@ static void test_ps_userstyle(void) ...@@ -547,11 +524,6 @@ static void test_ps_userstyle(void)
pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 3, NULL); pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 3, NULL);
ok(pen == 0, "ExtCreatePen should fail\n"); ok(pen == 0, "ExtCreatePen should fail\n");
if (pen == 0 && GetLastError() == 0xdeadbeef)
{
win_skip("Looks like 9x, skipping PS_USERSTYLE tests\n");
return;
}
expect(ERROR_INVALID_PARAMETER, GetLastError()); expect(ERROR_INVALID_PARAMETER, GetLastError());
DeleteObject(pen); DeleteObject(pen);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment