Commit 4f94913e authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

gdi32/tests: Replace FIELD_OFFSET with offsetof for the sake of consistency.

parent 14e20162
...@@ -240,12 +240,12 @@ static void test_logpen(void) ...@@ -240,12 +240,12 @@ static void test_logpen(void)
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == FIELD_OFFSET( 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());
break; break;
default: default:
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
} }
...@@ -283,7 +283,7 @@ static void test_logpen(void) ...@@ -283,7 +283,7 @@ static void test_logpen(void)
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == FIELD_OFFSET( 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);
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);
...@@ -292,7 +292,7 @@ static void test_logpen(void) ...@@ -292,7 +292,7 @@ static void test_logpen(void)
break; break;
default: default:
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), ok(size == offsetof( 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);
...@@ -350,12 +350,12 @@ test_geometric_pens: ...@@ -350,12 +350,12 @@ test_geometric_pens:
break; break;
case PS_USERSTYLE: case PS_USERSTYLE:
ok(size == FIELD_OFFSET( 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());
break; break;
default: default:
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), ok(size == offsetof( EXTLOGPEN, elpStyleEntry ),
"GetObject returned %d, error %d\n", size, GetLastError()); "GetObject returned %d, error %d\n", size, GetLastError());
break; break;
} }
...@@ -410,7 +410,7 @@ test_geometric_pens: ...@@ -410,7 +410,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 == FIELD_OFFSET( 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);
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);
...@@ -419,7 +419,7 @@ test_geometric_pens: ...@@ -419,7 +419,7 @@ test_geometric_pens:
break; break;
default: default:
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), ok(size == offsetof( 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);
...@@ -559,7 +559,7 @@ static void test_ps_userstyle(void) ...@@ -559,7 +559,7 @@ static void test_ps_userstyle(void)
ok(pen != 0, "ExtCreatePen should not fail\n"); ok(pen != 0, "ExtCreatePen should not fail\n");
size = GetObject(pen, sizeof(buffer), ext_pen); size = GetObject(pen, sizeof(buffer), ext_pen);
expect(FIELD_OFFSET(EXTLOGPEN,elpStyleEntry[16]), size); ok(size == offsetof(EXTLOGPEN, elpStyleEntry[16]), "wrong size %d\n", size);
for(i = 0; i < 16; i++) for(i = 0; i < 16; i++)
expect(style[i], ext_pen->elpStyleEntry[i]); expect(style[i], ext_pen->elpStyleEntry[i]);
...@@ -602,7 +602,7 @@ static void test_brush_pens(void) ...@@ -602,7 +602,7 @@ static void test_brush_pens(void)
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 = GetObject( pen, sizeof(buffer), elp );
ok( size == FIELD_OFFSET( 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 );
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
...@@ -627,7 +627,7 @@ static void test_brush_pens(void) ...@@ -627,7 +627,7 @@ static void test_brush_pens(void)
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 = GetObject( pen, sizeof(buffer), elp );
ok( size == FIELD_OFFSET( 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 );
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
...@@ -642,7 +642,7 @@ static void test_brush_pens(void) ...@@ -642,7 +642,7 @@ static void test_brush_pens(void)
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 = GetObject( pen, sizeof(buffer), elp );
ok( size == FIELD_OFFSET( 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 );
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
...@@ -668,7 +668,7 @@ static void test_brush_pens(void) ...@@ -668,7 +668,7 @@ static void test_brush_pens(void)
{ {
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 = GetObject( pen, sizeof(buffer), elp );
ok( size == FIELD_OFFSET( 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 );
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
......
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