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
5e5b7d56
Commit
5e5b7d56
authored
Aug 19, 2023
by
Jeff Smith
Committed by
Alexandre Julliard
Aug 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Create helper function for testing image properties.
parent
5e7877da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
31 deletions
+26
-31
image.c
dlls/gdiplus/tests/image.c
+26
-31
No files found.
dlls/gdiplus/tests/image.c
View file @
5e5b7d56
...
...
@@ -82,6 +82,30 @@ static void expect_rawformat(REFGUID expected, GpImage *img, int line, BOOL todo
expect_guid
(
expected
,
&
raw
,
line
,
todo
);
}
static
void
expect_image_properties
(
GpImage
*
image
,
UINT
width
,
UINT
height
,
int
line
)
{
GpStatus
stat
;
UINT
dim
;
ImageType
type
;
PixelFormat
format
;
stat
=
GdipGetImageWidth
(
image
,
&
dim
);
ok_
(
__FILE__
,
line
)(
stat
==
Ok
,
"Expected %d, got %d
\n
"
,
Ok
,
stat
);
ok_
(
__FILE__
,
line
)(
dim
==
width
,
"Expected %d, got %d
\n
"
,
width
,
dim
);
stat
=
GdipGetImageHeight
(
image
,
&
dim
);
ok_
(
__FILE__
,
line
)(
stat
==
Ok
,
"Expected %d, got %d
\n
"
,
Ok
,
stat
);
ok_
(
__FILE__
,
line
)(
dim
==
height
,
"Expected %d, got %d
\n
"
,
height
,
dim
);
stat
=
GdipGetImageType
(
image
,
&
type
);
ok_
(
__FILE__
,
line
)(
stat
==
Ok
,
"Expected %d, got %d
\n
"
,
Ok
,
stat
);
ok_
(
__FILE__
,
line
)(
type
==
ImageTypeBitmap
,
"Expected %d, got %d
\n
"
,
ImageTypeBitmap
,
type
);
stat
=
GdipGetImagePixelFormat
(
image
,
&
format
);
ok_
(
__FILE__
,
line
)(
stat
==
Ok
,
"Expected %d, got %d
\n
"
,
Ok
,
stat
);
ok_
(
__FILE__
,
line
)(
format
==
PixelFormat32bppARGB
,
"Expected %d, got %d
\n
"
,
PixelFormat32bppARGB
,
format
);
}
static
BOOL
get_encoder_clsid
(
LPCWSTR
mime
,
GUID
*
format
,
CLSID
*
clsid
)
{
GpStatus
status
;
...
...
@@ -1542,9 +1566,6 @@ static void test_fromhicon(void)
HICON
hIcon
;
GpStatus
stat
;
GpBitmap
*
bitmap
=
NULL
;
UINT
dim
;
ImageType
type
;
PixelFormat
format
;
/* NULL */
stat
=
GdipCreateBitmapFromHICON
(
NULL
,
NULL
);
...
...
@@ -1570,20 +1591,7 @@ static void test_fromhicon(void)
broken
(
stat
==
InvalidParameter
),
/* Win98 */
"Expected Ok, got %.8x
\n
"
,
stat
);
if
(
stat
==
Ok
){
/* check attributes */
stat
=
GdipGetImageHeight
((
GpImage
*
)
bitmap
,
&
dim
);
expect
(
Ok
,
stat
);
expect
(
16
,
dim
);
stat
=
GdipGetImageWidth
((
GpImage
*
)
bitmap
,
&
dim
);
expect
(
Ok
,
stat
);
expect
(
16
,
dim
);
stat
=
GdipGetImageType
((
GpImage
*
)
bitmap
,
&
type
);
expect
(
Ok
,
stat
);
expect
(
ImageTypeBitmap
,
type
);
stat
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
Ok
,
stat
);
expect
(
PixelFormat32bppARGB
,
format
);
/* raw format */
expect_image_properties
((
GpImage
*
)
bitmap
,
16
,
16
,
__LINE__
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
FALSE
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
...
...
@@ -1605,20 +1613,7 @@ static void test_fromhicon(void)
stat
=
GdipCreateBitmapFromHICON
(
hIcon
,
&
bitmap
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
){
/* check attributes */
stat
=
GdipGetImageHeight
((
GpImage
*
)
bitmap
,
&
dim
);
expect
(
Ok
,
stat
);
expect
(
16
,
dim
);
stat
=
GdipGetImageWidth
((
GpImage
*
)
bitmap
,
&
dim
);
expect
(
Ok
,
stat
);
expect
(
16
,
dim
);
stat
=
GdipGetImageType
((
GpImage
*
)
bitmap
,
&
type
);
expect
(
Ok
,
stat
);
expect
(
ImageTypeBitmap
,
type
);
stat
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
Ok
,
stat
);
expect
(
PixelFormat32bppARGB
,
format
);
/* raw format */
expect_image_properties
((
GpImage
*
)
bitmap
,
16
,
16
,
__LINE__
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
FALSE
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
...
...
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