Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f60d2b63
Commit
f60d2b63
authored
Sep 09, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add more tests for GdipGetMetafileHeaderFromMetafile.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
259837a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
0 deletions
+120
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+120
-0
No files found.
dlls/gdiplus/tests/metafile.c
View file @
f60d2b63
...
...
@@ -360,6 +360,34 @@ static void test_empty(void)
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
metafile
,
&
yres
);
expect
(
Ok
,
stat
);
memset
(
&
header
,
0xaa
,
sizeof
(
header
));
stat
=
GdipGetMetafileHeaderFromMetafile
(
metafile
,
&
header
);
expect
(
Ok
,
stat
);
expect
(
MetafileTypeEmfPlusOnly
,
header
.
Type
);
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
ok
(
header
.
Version
==
0xdbc01001
||
header
.
Version
==
0xdbc01002
,
"Unexpected version %x
\n
"
,
header
.
Version
);
expect
(
1
,
header
.
EmfPlusFlags
);
/* reference device was display, not printer */
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
expect
(
100
,
header
.
Height
);
expect
(
28
,
header
.
EmfPlusHeaderSize
);
expect
(
96
,
header
.
LogicalDpiX
);
expect
(
96
,
header
.
LogicalDpiX
);
expect
(
EMR_HEADER
,
U
(
header
).
EmfHeader
.
iType
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclBounds
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclBounds
.
top
);
expect
(
-
1
,
U
(
header
).
EmfHeader
.
rclBounds
.
right
);
expect
(
-
1
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipGetHemfFromMetafile
(
metafile
,
&
hemf
);
expect
(
Ok
,
stat
);
...
...
@@ -418,6 +446,34 @@ static void test_empty(void)
expect
(
Ok
,
stat
);
expectf
(
header
.
DpiY
,
yres
);
memset
(
&
header
,
0xaa
,
sizeof
(
header
));
stat
=
GdipGetMetafileHeaderFromMetafile
(
metafile
,
&
header
);
expect
(
Ok
,
stat
);
expect
(
MetafileTypeEmfPlusOnly
,
header
.
Type
);
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
ok
(
header
.
Version
==
0xdbc01001
||
header
.
Version
==
0xdbc01002
,
"Unexpected version %x
\n
"
,
header
.
Version
);
expect
(
1
,
header
.
EmfPlusFlags
);
/* reference device was display, not printer */
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
expect
(
100
,
header
.
Height
);
expect
(
28
,
header
.
EmfPlusHeaderSize
);
expect
(
96
,
header
.
LogicalDpiX
);
expect
(
96
,
header
.
LogicalDpiX
);
expect
(
EMR_HEADER
,
U
(
header
).
EmfHeader
.
iType
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclBounds
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclBounds
.
top
);
expect
(
-
1
,
U
(
header
).
EmfHeader
.
rclBounds
.
right
);
expect
(
-
1
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
}
...
...
@@ -603,6 +659,13 @@ static void test_emfonly(void)
stat
=
GdipGetHemfFromMetafile
(
metafile
,
&
hemf
);
expect
(
InvalidParameter
,
stat
);
memset
(
&
header
,
0xaa
,
sizeof
(
header
));
stat
=
GdipGetMetafileHeaderFromMetafile
(
metafile
,
&
header
);
expect
(
Ok
,
stat
);
expect
(
MetafileTypeEmf
,
header
.
Type
);
ok
(
header
.
Version
==
0xdbc01001
||
header
.
Version
==
0xdbc01002
,
"Unexpected version %x
\n
"
,
header
.
Version
);
/* The rest is zeroed or seemingly random/uninitialized garbage. */
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
metafile
,
&
graphics
);
expect
(
Ok
,
stat
);
...
...
@@ -650,6 +713,35 @@ static void test_emfonly(void)
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
metafile
,
&
yres
);
expect
(
Ok
,
stat
);
memset
(
&
header
,
0xaa
,
sizeof
(
header
));
stat
=
GdipGetMetafileHeaderFromMetafile
(
metafile
,
&
header
);
expect
(
Ok
,
stat
);
expect
(
MetafileTypeEmf
,
header
.
Type
);
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
/* For some reason a recoreded EMF Metafile has an EMF+ version. */
todo_wine
ok
(
header
.
Version
==
0xdbc01001
||
header
.
Version
==
0xdbc01002
,
"Unexpected version %x
\n
"
,
header
.
Version
);
expect
(
0
,
header
.
EmfPlusFlags
);
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
expect
(
100
,
header
.
Height
);
expect
(
0
,
header
.
EmfPlusHeaderSize
);
expect
(
0
,
header
.
LogicalDpiX
);
expect
(
0
,
header
.
LogicalDpiX
);
expect
(
EMR_HEADER
,
U
(
header
).
EmfHeader
.
iType
);
expect
(
25
,
U
(
header
).
EmfHeader
.
rclBounds
.
left
);
expect
(
25
,
U
(
header
).
EmfHeader
.
rclBounds
.
top
);
expect
(
74
,
U
(
header
).
EmfHeader
.
rclBounds
.
right
);
expect
(
74
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
...
...
@@ -765,6 +857,34 @@ static void test_emfonly(void)
expect
(
Ok
,
stat
);
expectf
(
header
.
DpiY
,
yres
);
memset
(
&
header
,
0xaa
,
sizeof
(
header
));
stat
=
GdipGetMetafileHeaderFromMetafile
(
metafile
,
&
header
);
expect
(
Ok
,
stat
);
expect
(
MetafileTypeEmf
,
header
.
Type
);
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
expect
(
0x10000
,
header
.
Version
);
expect
(
0
,
header
.
EmfPlusFlags
);
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
expect
(
100
,
header
.
Height
);
expect
(
0
,
header
.
EmfPlusHeaderSize
);
expect
(
0
,
header
.
LogicalDpiX
);
expect
(
0
,
header
.
LogicalDpiX
);
expect
(
EMR_HEADER
,
U
(
header
).
EmfHeader
.
iType
);
expect
(
25
,
U
(
header
).
EmfHeader
.
rclBounds
.
left
);
expect
(
25
,
U
(
header
).
EmfHeader
.
rclBounds
.
top
);
expect
(
74
,
U
(
header
).
EmfHeader
.
rclBounds
.
right
);
expect
(
74
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
}
...
...
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