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
f8d6d030
Commit
f8d6d030
authored
Feb 27, 2012
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: LONG/ULONG and error checking fixes.
parent
6ee15adf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
34 deletions
+36
-34
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+14
-12
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+11
-11
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+11
-11
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
f8d6d030
...
...
@@ -884,7 +884,7 @@ static void test_coop_level_threaded(void)
destroy_window_thread
(
&
p
);
}
static
LONG
get_refcount
(
IUnknown
*
test_iface
)
static
U
LONG
get_refcount
(
IUnknown
*
test_iface
)
{
IUnknown_AddRef
(
test_iface
);
return
IUnknown_Release
(
test_iface
);
...
...
@@ -895,7 +895,7 @@ static void test_viewport_interfaces(void)
IDirectDraw
*
ddraw
;
IDirect3D
*
d3d
;
HRESULT
hr
;
LONG
ref
;
U
LONG
ref
;
IDirect3DViewport
*
viewport
;
IDirect3DViewport2
*
viewport2
;
IDirect3DViewport3
*
viewport3
;
...
...
@@ -921,9 +921,9 @@ static void test_viewport_interfaces(void)
hr
=
IDirect3D_CreateViewport
(
d3d
,
&
viewport
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create viewport, hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
d3d
);
ok
(
ref
==
2
,
"IDirect3D refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3D refcount is %
u
\n
"
,
ref
);
/* E_FAIL return values are returned by Winetestbot Windows NT machines. While not supporting
* newer interfaces is legitimate for old ddraw versions, E_FAIL violates Microsoft's rules
...
...
@@ -936,25 +936,27 @@ static void test_viewport_interfaces(void)
/* NULL iid: Segfaults */
hr
=
IDirect3DViewport_QueryInterface
(
viewport
,
&
IID_IDirect3DViewport2
,
(
void
**
)
&
viewport2
);
ok
(
SUCCEEDED
(
hr
)
||
broken
(
hr
==
E_FAIL
),
"Failed to QI IDirect3DViewport2, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
E_NOINTERFACE
||
broken
(
hr
==
E_FAIL
),
"Failed to QI IDirect3DViewport2, hr %#x.
\n
"
,
hr
);
if
(
viewport2
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport2_Release
(
viewport2
);
viewport2
=
NULL
;
}
hr
=
IDirect3DViewport_QueryInterface
(
viewport
,
&
IID_IDirect3DViewport3
,
(
void
**
)
&
viewport3
);
ok
(
SUCCEEDED
(
hr
)
||
broken
(
hr
==
E_FAIL
),
"Failed to QI IDirect3DViewport3, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
E_NOINTERFACE
||
broken
(
hr
==
E_FAIL
),
"Failed to QI IDirect3DViewport3, hr %#x.
\n
"
,
hr
);
if
(
viewport3
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport3_Release
(
viewport3
);
}
...
...
@@ -963,9 +965,9 @@ static void test_viewport_interfaces(void)
if
(
unknown
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
(
unknown
);
ok
(
ref
==
2
,
"IUnknown refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IUnknown refcount is %
u
\n
"
,
ref
);
IUnknown_Release
(
unknown
);
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
f8d6d030
...
...
@@ -1179,7 +1179,7 @@ done:
if
(
ddraw
)
IDirectDraw2_Release
(
ddraw
);
}
static
LONG
get_refcount
(
IUnknown
*
test_iface
)
static
U
LONG
get_refcount
(
IUnknown
*
test_iface
)
{
IUnknown_AddRef
(
test_iface
);
return
IUnknown_Release
(
test_iface
);
...
...
@@ -1190,7 +1190,7 @@ static void test_viewport_interfaces(void)
IDirectDraw2
*
ddraw
;
IDirect3D2
*
d3d
;
HRESULT
hr
;
LONG
ref
,
old_d3d_ref
;
U
LONG
ref
,
old_d3d_ref
;
IDirect3DViewport
*
viewport
;
IDirect3DViewport2
*
viewport2
;
IDirect3DViewport3
*
viewport3
;
...
...
@@ -1216,9 +1216,9 @@ static void test_viewport_interfaces(void)
hr
=
IDirect3D2_CreateViewport
(
d3d
,
&
viewport2
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create viewport, hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
d3d
);
ok
(
ref
==
old_d3d_ref
,
"IDirect3D2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
old_d3d_ref
,
"IDirect3D2 refcount is %
u
\n
"
,
ref
);
gamma
=
(
IDirectDrawGammaControl
*
)
0xdeadbeef
;
hr
=
IDirect3DViewport2_QueryInterface
(
viewport2
,
&
IID_IDirectDrawGammaControl
,
(
void
**
)
&
gamma
);
...
...
@@ -1232,21 +1232,21 @@ static void test_viewport_interfaces(void)
if
(
viewport
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport_Release
(
viewport
);
viewport
=
NULL
;
}
hr
=
IDirect3DViewport2_QueryInterface
(
viewport2
,
&
IID_IDirect3DViewport3
,
(
void
**
)
&
viewport3
);
ok
(
SUCCEEDED
(
hr
),
"Failed to QI IDirect3DViewport3, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
E_NOINTERFACE
,
"Failed to QI IDirect3DViewport3, hr %#x.
\n
"
,
hr
);
if
(
viewport3
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport3_Release
(
viewport3
);
}
...
...
@@ -1255,9 +1255,9 @@ static void test_viewport_interfaces(void)
if
(
unknown
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
(
unknown
);
ok
(
ref
==
2
,
"IUnknown refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IUnknown refcount is %
u
\n
"
,
ref
);
IUnknown_Release
(
unknown
);
}
...
...
dlls/ddraw/tests/ddraw4.c
View file @
f8d6d030
...
...
@@ -1310,7 +1310,7 @@ static void test_texture_load_ckey(void)
IDirectDraw4_Release
(
ddraw
);
}
static
LONG
get_refcount
(
IUnknown
*
test_iface
)
static
U
LONG
get_refcount
(
IUnknown
*
test_iface
)
{
IUnknown_AddRef
(
test_iface
);
return
IUnknown_Release
(
test_iface
);
...
...
@@ -1321,7 +1321,7 @@ static void test_viewport_interfaces(void)
IDirectDraw4
*
ddraw
;
IDirect3D3
*
d3d
;
HRESULT
hr
,
old_d3d_ref
;
LONG
ref
;
U
LONG
ref
;
IDirect3DViewport
*
viewport
;
IDirect3DViewport2
*
viewport2
;
IDirect3DViewport3
*
viewport3
;
...
...
@@ -1346,9 +1346,9 @@ static void test_viewport_interfaces(void)
hr
=
IDirect3D3_CreateViewport
(
d3d
,
&
viewport3
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create viewport, hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
1
,
"Initial IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
d3d
);
ok
(
ref
==
old_d3d_ref
,
"IDirect3D3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
old_d3d_ref
,
"IDirect3D3 refcount is %
u
\n
"
,
ref
);
gamma
=
(
IDirectDrawGammaControl
*
)
0xdeadbeef
;
hr
=
IDirect3DViewport2_QueryInterface
(
viewport3
,
&
IID_IDirectDrawGammaControl
,
(
void
**
)
&
gamma
);
...
...
@@ -1362,9 +1362,9 @@ static void test_viewport_interfaces(void)
if
(
viewport
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport_Release
(
viewport
);
viewport
=
NULL
;
}
...
...
@@ -1374,20 +1374,20 @@ static void test_viewport_interfaces(void)
if
(
viewport2
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport2
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport2 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
IDirect3DViewport3_Release
(
viewport2
);
}
hr
=
IDirect3DViewport3_QueryInterface
(
viewport
2
,
&
IID_IUnknown
,
(
void
**
)
&
unknown
);
hr
=
IDirect3DViewport3_QueryInterface
(
viewport
3
,
&
IID_IUnknown
,
(
void
**
)
&
unknown
);
ok
(
SUCCEEDED
(
hr
),
"Failed to QI IUnknown, hr %#x.
\n
"
,
hr
);
if
(
unknown
)
{
ref
=
get_refcount
((
IUnknown
*
)
viewport3
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IDirect3DViewport3 refcount is %
u
\n
"
,
ref
);
ref
=
get_refcount
(
unknown
);
ok
(
ref
==
2
,
"IUnknown refcount is %
d
\n
"
,
ref
);
ok
(
ref
==
2
,
"IUnknown refcount is %
u
\n
"
,
ref
);
IUnknown_Release
(
unknown
);
}
...
...
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