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
6332297b
Commit
6332297b
authored
Jan 24, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add option to save metafile tests to files.
parent
3f8864ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+42
-0
No files found.
dlls/gdiplus/tests/metafile.c
View file @
6332297b
...
...
@@ -27,6 +27,8 @@
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got))
static
BOOL
save_metafiles
;
typedef
struct
emfplus_record
{
BOOL
todo
;
...
...
@@ -248,6 +250,29 @@ static void play_metafile(GpMetafile *metafile, GpGraphics *graphics, const emfp
expect
(
Ok
,
stat
);
}
static
void
save_metafile
(
GpMetafile
*
metafile
,
const
char
*
filename
)
{
if
(
save_metafiles
)
{
GpMetafile
*
clone
;
HENHMETAFILE
hemf
;
GpStatus
stat
;
stat
=
GdipCloneImage
((
GpImage
*
)
metafile
,
(
GpImage
**
)
&
clone
);
expect
(
Ok
,
stat
);
stat
=
GdipGetHemfFromMetafile
(
clone
,
&
hemf
);
expect
(
Ok
,
stat
);
DeleteEnhMetaFile
(
CopyEnhMetaFileA
(
hemf
,
filename
));
DeleteEnhMetaFile
(
hemf
);
stat
=
GdipDisposeImage
((
GpImage
*
)
clone
);
expect
(
Ok
,
stat
);
}
}
static
const
emfplus_record
empty_records
[]
=
{
{
0
,
EMR_HEADER
},
{
0
,
EmfPlusRecordTypeHeader
},
...
...
@@ -310,6 +335,8 @@ static void test_empty(void)
check_metafile
(
metafile
,
empty_records
,
"empty metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
save_metafile
(
metafile
,
"empty.emf"
);
stat
=
GdipGetHemfFromMetafile
(
metafile
,
&
hemf
);
expect
(
Ok
,
stat
);
...
...
@@ -399,6 +426,8 @@ static void test_getdc(void)
check_metafile
(
metafile
,
getdc_records
,
"getdc metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
save_metafile
(
metafile
,
"getdc.emf"
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
...
...
@@ -532,6 +561,8 @@ static void test_emfonly(void)
check_metafile
(
metafile
,
emfonly_records
,
"emfonly metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
save_metafile
(
metafile
,
"emfonly.emf"
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
...
...
@@ -658,6 +689,8 @@ static void test_fillrect(void)
check_metafile
(
metafile
,
fillrect_records
,
"fillrect metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
save_metafile
(
metafile
,
"fillrect.emf"
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
...
...
@@ -869,6 +902,8 @@ static void test_pagetransform(void)
check_metafile
(
metafile
,
pagetransform_records
,
"pagetransform metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
save_metafile
(
metafile
,
"pagetransform.emf"
);
stat
=
GdipCreateBitmapFromScan0
(
100
,
100
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
...
...
@@ -915,6 +950,8 @@ START_TEST(metafile)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
ULONG_PTR
gdiplusToken
;
int
myARGC
;
char
**
myARGV
;
gdiplusStartupInput
.
GdiplusVersion
=
1
;
gdiplusStartupInput
.
DebugEventCallback
=
NULL
;
...
...
@@ -923,6 +960,11 @@ START_TEST(metafile)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
if
(
myARGC
>=
3
&&
!
strcmp
(
myARGV
[
2
],
"save"
))
save_metafiles
=
TRUE
;
test_empty
();
test_getdc
();
test_emfonly
();
...
...
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