Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
14e20162
Commit
14e20162
authored
Aug 19, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Use offsetof instead of sizeof on structs with VLA.
parent
da425748
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
pen.c
dlls/gdi32/tests/pen.c
+6
-5
No files found.
dlls/gdi32/tests/pen.c
View file @
14e20162
...
...
@@ -153,7 +153,8 @@ static void test_logpen(void)
if
(
pen
[
i
].
style
==
PS_NULL
)
{
ok
(
hpen
==
GetStockObject
(
NULL_PEN
),
"hpen should be a stock NULL_PEN
\n
"
);
ok
(
size
==
sizeof
(
EXTLOGPEN
),
"GetObject returned %d, error %d
\n
"
,
size
,
GetLastError
());
ok
(
size
==
offsetof
(
EXTLOGPEN
,
elpStyleEntry
[
1
]),
"GetObject returned %d, error %d
\n
"
,
size
,
GetLastError
());
ok
(
elp
.
elpPenStyle
==
pen
[
i
].
ret_style
,
"expected %u, got %u
\n
"
,
pen
[
i
].
ret_style
,
elp
.
elpPenStyle
);
ok
(
elp
.
elpWidth
==
0
,
"expected 0, got %u
\n
"
,
elp
.
elpWidth
);
ok
(
elp
.
elpColor
==
pen
[
i
].
ret_color
,
"expected %08x, got %08x
\n
"
,
pen
[
i
].
ret_color
,
elp
.
elpColor
);
...
...
@@ -275,7 +276,7 @@ static void test_logpen(void)
memset
(
&
unset_hatch
,
0xb0
,
sizeof
(
unset_hatch
));
SetLastError
(
0xdeadbeef
);
size
=
GetObject
(
hpen
,
sizeof
(
elp
),
&
elp
);
ok
(
size
==
sizeof
(
EXTLOGPEN
),
ok
(
size
==
offsetof
(
EXTLOGPEN
,
elpStyleEntry
[
1
]
),
"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
->
elpNumEntries
==
0xb0b0b0b0
,
"expected 0xb0b0b0b0, got %x
\n
"
,
ext_pen
->
elpNumEntries
);
...
...
@@ -385,11 +386,11 @@ test_geometric_pens:
memset
(
elp_buffer
,
0xb0
,
sizeof
(
elp_buffer
));
SetLastError
(
0xdeadbeef
);
/* buffer is too small for user styles */
size
=
GetObject
(
hpen
,
sizeof
(
EXTLOGPEN
),
elp_buffer
);
size
=
GetObject
(
hpen
,
offsetof
(
EXTLOGPEN
,
elpStyleEntry
[
1
]
),
elp_buffer
);
switch
(
pen
[
i
].
style
)
{
case
PS_NULL
:
ok
(
size
==
sizeof
(
EXTLOGPEN
),
ok
(
size
==
offsetof
(
EXTLOGPEN
,
elpStyleEntry
[
1
]
),
"GetObject returned %d, error %d
\n
"
,
size
,
GetLastError
());
ok
(
ext_pen
->
elpHatch
==
0
,
"expected 0, got %p
\n
"
,
(
void
*
)
ext_pen
->
elpHatch
);
ok
(
ext_pen
->
elpNumEntries
==
0
,
"expected 0, got %x
\n
"
,
ext_pen
->
elpNumEntries
);
...
...
@@ -568,7 +569,7 @@ static void test_ps_userstyle(void)
static
void
test_brush_pens
(
void
)
{
char
buffer
[
sizeof
(
EXTLOGPEN
)
+
15
*
sizeof
(
DWORD
)];
char
buffer
[
offsetof
(
EXTLOGPEN
,
elpStyleEntry
[
16
]
)];
EXTLOGPEN
*
elp
=
(
EXTLOGPEN
*
)
buffer
;
LOGBRUSH
lb
;
HPEN
pen
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment