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
34a701f2
Commit
34a701f2
authored
Jun 22, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Jun 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Test value size checking for custom properties.
Signed-off-by:
Ziqing Hui
<
zhui@codeweavers.com
>
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
5a58ea8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
d2d1.c
dlls/d2d1/tests/d2d1.c
+25
-3
No files found.
dlls/d2d1/tests/d2d1.c
View file @
34a701f2
...
...
@@ -10690,7 +10690,7 @@ static HRESULT STDMETHODCALLTYPE effect_impl_set_integer(IUnknown *iface, const
{
struct
effect_impl
*
effect_impl
=
impl_from_ID2D1EffectImpl
((
ID2D1EffectImpl
*
)
iface
);
if
(
!
data
||
data_size
!=
sizeof
(
effect_impl
->
integer
)
)
if
(
!
data
)
return
E_INVALIDARG
;
effect_impl
->
integer
=
*
((
UINT
*
)
data
);
...
...
@@ -10703,7 +10703,7 @@ static HRESULT STDMETHODCALLTYPE effect_impl_get_integer(const IUnknown *iface,
{
struct
effect_impl
*
effect_impl
=
impl_from_ID2D1EffectImpl
((
ID2D1EffectImpl
*
)
iface
);
if
(
!
data
||
data_size
!=
sizeof
(
effect_impl
->
integer
)
)
if
(
!
data
)
return
E_INVALIDARG
;
*
((
UINT
*
)
data
)
=
effect_impl
->
integer
;
...
...
@@ -10718,7 +10718,7 @@ static HRESULT STDMETHODCALLTYPE effect_impl_get_context(const IUnknown *iface,
{
struct
effect_impl
*
effect_impl
=
impl_from_ID2D1EffectImpl
((
ID2D1EffectImpl
*
)
iface
);
if
(
!
data
||
data_size
!=
sizeof
(
effect_impl
->
effect_context
)
)
if
(
!
data
)
return
E_INVALIDARG
;
*
((
ID2D1EffectContext
**
)
data
)
=
effect_impl
->
effect_context
;
...
...
@@ -11248,12 +11248,22 @@ static void test_effect_properties(BOOL d3d11)
effect_context
=
(
ID2D1EffectContext
*
)
0xdeadbeef
;
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
)
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
)
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
effect_context
!=
NULL
&&
effect_context
!=
(
ID2D1EffectContext
*
)
0xdeadbeef
,
"Got unexpected effect context %p.
\n
"
,
effect_context
);
effect_context
=
(
ID2D1EffectContext
*
)
0xdeadbeef
;
hr
=
ID2D1Effect_GetValue
(
effect
,
0
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
)
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValue
(
effect
,
0
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
)
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValue
(
effect
,
0
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
effect_context
!=
NULL
&&
effect_context
!=
(
ID2D1EffectContext
*
)
0xdeadbeef
,
...
...
@@ -11263,16 +11273,28 @@ static void test_effect_properties(BOOL d3d11)
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
integer
=
0xdeadbeef
;
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Integer"
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Integer"
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Integer"
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
integer
==
10
,
"Got unexpected integer %u."
,
integer
);
integer
=
0xdeadbeef
;
hr
=
ID2D1Effect_GetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
-
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_GetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
integer
==
10
,
"Got unexpected integer %u."
,
integer
);
integer
=
20
;
hr
=
ID2D1Effect_SetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
-
1
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_SetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
)
+
1
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Effect_SetValue
(
effect
,
1
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
integer
=
0xdeadbeef
;
...
...
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