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
29a5d9b3
Commit
29a5d9b3
authored
Oct 19, 2010
by
Krzysztof Nowicki
Committed by
Alexandre Julliard
Oct 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs/tests: Add test cases for *_CopyPixels calls with NULL rectangle.
parent
145bda5a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+4
-0
converter.c
dlls/windowscodecs/tests/converter.c
+33
-0
No files found.
dlls/windowscodecs/tests/bmpformat.c
View file @
29a5d9b3
...
@@ -197,6 +197,10 @@ static void test_decode_24bpp(void)
...
@@ -197,6 +197,10 @@ static void test_decode_24bpp(void)
ok
(
SUCCEEDED
(
hr
),
"CopyPixels failed, hr=%x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CopyPixels failed, hr=%x
\n
"
,
hr
);
ok
(
!
memcmp
(
imagedata
,
expected_imagedata
,
sizeof
(
imagedata
)),
"unexpected image data
\n
"
);
ok
(
!
memcmp
(
imagedata
,
expected_imagedata
,
sizeof
(
imagedata
)),
"unexpected image data
\n
"
);
hr
=
IWICBitmapFrameDecode_CopyPixels
(
framedecode
,
NULL
,
6
,
sizeof
(
imagedata
),
imagedata
);
ok
(
SUCCEEDED
(
hr
),
"CopyPixels(rect=NULL) failed, hr=%x
\n
"
,
hr
);
ok
(
!
memcmp
(
imagedata
,
expected_imagedata
,
sizeof
(
imagedata
)),
"unexpected image data
\n
"
);
IWICBitmapFrameDecode_Release
(
framedecode
);
IWICBitmapFrameDecode_Release
(
framedecode
);
}
}
...
...
dlls/windowscodecs/tests/converter.c
View file @
29a5d9b3
...
@@ -110,9 +110,21 @@ static HRESULT WINAPI BitmapTestSrc_CopyPixels(IWICBitmapSource *iface,
...
@@ -110,9 +110,21 @@ static HRESULT WINAPI BitmapTestSrc_CopyPixels(IWICBitmapSource *iface,
UINT
bytesperrow
;
UINT
bytesperrow
;
UINT
srcstride
;
UINT
srcstride
;
UINT
row_offset
;
UINT
row_offset
;
WICRect
rc
;
if
(
!
prc
)
{
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
This
->
data
->
width
;
rc
.
Height
=
This
->
data
->
height
;
prc
=
&
rc
;
}
else
{
if
(
prc
->
X
<
0
||
prc
->
Y
<
0
||
prc
->
X
+
prc
->
Width
>
This
->
data
->
width
||
prc
->
Y
+
prc
->
Height
>
This
->
data
->
height
)
if
(
prc
->
X
<
0
||
prc
->
Y
<
0
||
prc
->
X
+
prc
->
Width
>
This
->
data
->
width
||
prc
->
Y
+
prc
->
Height
>
This
->
data
->
height
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
bytesperrow
=
((
This
->
data
->
bpp
*
prc
->
Width
)
+
7
)
/
8
;
bytesperrow
=
((
This
->
data
->
bpp
*
prc
->
Width
)
+
7
)
/
8
;
srcstride
=
((
This
->
data
->
bpp
*
This
->
data
->
width
)
+
7
)
/
8
;
srcstride
=
((
This
->
data
->
bpp
*
This
->
data
->
width
)
+
7
)
/
8
;
...
@@ -233,6 +245,27 @@ static void compare_bitmap_data(const struct bitmap_data *expect, IWICBitmapSour
...
@@ -233,6 +245,27 @@ static void compare_bitmap_data(const struct bitmap_data *expect, IWICBitmapSour
}
}
else
else
ok
(
memcmp
(
expect
->
bits
,
converted_bits
,
buffersize
)
==
0
,
"unexpected pixel data (%s)
\n
"
,
name
);
ok
(
memcmp
(
expect
->
bits
,
converted_bits
,
buffersize
)
==
0
,
"unexpected pixel data (%s)
\n
"
,
name
);
/* Test with NULL rectangle - should copy the whole bitmap */
hr
=
IWICBitmapSource_CopyPixels
(
source
,
NULL
,
stride
,
buffersize
,
converted_bits
);
ok
(
SUCCEEDED
(
hr
),
"CopyPixels(%s,rc=NULL) failed, hr=%x
\n
"
,
name
,
hr
);
if
(
IsEqualGUID
(
expect
->
format
,
&
GUID_WICPixelFormat32bppBGR
))
{
/* ignore the padding byte when comparing data */
UINT
i
;
BOOL
equal
=
TRUE
;
const
DWORD
*
a
=
(
const
DWORD
*
)
expect
->
bits
,
*
b
=
(
const
DWORD
*
)
converted_bits
;
for
(
i
=
0
;
i
<
(
buffersize
/
4
);
i
++
)
if
((
a
[
i
]
&
0xffffff
)
!=
(
b
[
i
]
&
0xffffff
))
{
equal
=
FALSE
;
break
;
}
ok
(
equal
,
"unexpected pixel data with rc=NULL (%s)
\n
"
,
name
);
}
else
ok
(
memcmp
(
expect
->
bits
,
converted_bits
,
buffersize
)
==
0
,
"unexpected pixel data with rc=NULL (%s)
\n
"
,
name
);
HeapFree
(
GetProcessHeap
(),
0
,
converted_bits
);
HeapFree
(
GetProcessHeap
(),
0
,
converted_bits
);
}
}
...
...
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