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
67e811cc
Commit
67e811cc
authored
Mar 10, 2008
by
Nathan Beckmann
Committed by
Alexandre Julliard
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add more sophisticated tests for GdipSaveImageToFile.
Add a test to make sure the saved image has the same dimensions as original. Delete the test file when finished.
parent
75841d83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
image.c
dlls/gdiplus/tests/image.c
+19
-2
No files found.
dlls/gdiplus/tests/image.c
View file @
67e811cc
...
...
@@ -128,6 +128,8 @@ static void test_SavingImages(void)
GpBitmap
*
bm
;
UINT
n
;
UINT
s
;
const
REAL
WIDTH
=
10
.
0
,
HEIGHT
=
20
.
0
;
REAL
w
,
h
;
ImageCodecInfo
*
codecs
;
static
const
WCHAR
filename
[]
=
{
'a'
,
'.'
,
'b'
,
'm'
,
'p'
,
0
};
...
...
@@ -137,7 +139,7 @@ static void test_SavingImages(void)
expect
(
InvalidParameter
,
stat
);
bm
=
NULL
;
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
1
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
if
(
!
bm
)
return
;
...
...
@@ -149,7 +151,7 @@ static void test_SavingImages(void)
stat
=
GdipSaveImageToFile
((
GpImage
*
)
bm
,
filename
,
0
,
0
);
expect
(
InvalidParameter
,
stat
);
/*
this should succe
ed */
/*
encoder tests should succeed -- already test
ed */
stat
=
GdipGetImageEncodersSize
(
&
n
,
&
s
);
if
(
stat
!=
Ok
||
n
==
0
)
goto
cleanup
;
...
...
@@ -162,11 +164,26 @@ static void test_SavingImages(void)
stat
=
GdipSaveImageToFile
((
GpImage
*
)
bm
,
filename
,
&
codecs
[
0
].
Clsid
,
0
);
expect
(
stat
,
Ok
);
GdipDisposeImage
((
GpImage
*
)
bm
);
bm
=
0
;
/* re-load and check image stats */
stat
=
GdipLoadImageFromFile
(
filename
,
(
GpImage
**
)
&
bm
);
expect
(
stat
,
Ok
);
if
(
stat
!=
Ok
)
goto
cleanup
;
stat
=
GdipGetImageDimension
((
GpImage
*
)
bm
,
&
w
,
&
h
);
if
(
stat
!=
Ok
)
goto
cleanup
;
ok
((
fabs
(
w
-
WIDTH
)
<
0
.
01
)
&&
(
fabs
(
h
-
HEIGHT
)
<
0
.
01
),
"Saved image dimensions are different!
\n
"
);
cleanup:
if
(
codecs
)
GdipFree
(
codecs
);
if
(
bm
)
GdipDisposeImage
((
GpImage
*
)
bm
);
ok
(
DeleteFileW
(
filename
),
"Delete failed.
\n
"
);
}
static
void
test_encoders
(
void
)
...
...
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