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
cf943820
Commit
cf943820
authored
May 05, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic/tests: Add some IDirectMusic_SetDirectSound() tests.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
10db51d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
1 deletion
+74
-1
Makefile.in
dlls/dmusic/tests/Makefile.in
+1
-1
dmusic.c
dlls/dmusic/tests/dmusic.c
+73
-0
No files found.
dlls/dmusic/tests/Makefile.in
View file @
cf943820
TESTDLL
=
dmusic.dll
IMPORTS
=
oleaut32 ole32 uuid
IMPORTS
=
oleaut32 ole32 uuid
user32 dsound
C_SRCS
=
\
dmusic.c
dlls/dmusic/tests/dmusic.c
View file @
cf943820
...
...
@@ -122,6 +122,78 @@ static void test_dmusic(void)
IDirectMusic_Release
(
dmusic
);
}
static
ULONG
get_refcount
(
IDirectSound
*
iface
)
{
IDirectSound_AddRef
(
iface
);
return
IDirectSound_Release
(
iface
);
}
static
void
test_setdsound
(
void
)
{
IDirectMusic
*
dmusic
;
IDirectSound
*
dsound
,
*
dsound2
;
HRESULT
hr
;
ULONG
ref
;
/* Old dsound without SetCooperativeLevel() */
hr
=
DirectSoundCreate
(
NULL
,
&
dsound
,
NULL
);
if
(
hr
==
DSERR_NODRIVER
)
{
skip
(
"No driver
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"DirectSoundCreate failed: %08x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_DirectMusic
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusic8
,
(
void
**
)
&
dmusic
);
ok
(
hr
==
S_OK
,
"DirectMusic create failed: %08x
\n
"
,
hr
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
IDirectMusic_Release
(
dmusic
);
IDirectSound_Release
(
dsound
);
/* dsound ref counting */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusic
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusic8
,
(
void
**
)
&
dmusic
);
ok
(
hr
==
S_OK
,
"DirectMusic create failed: %08x
\n
"
,
hr
);
hr
=
DirectSoundCreate8
(
NULL
,
(
IDirectSound8
**
)
&
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"DirectSoundCreate failed: %08x
\n
"
,
hr
);
hr
=
IDirectSound_SetCooperativeLevel
(
dsound
,
GetForegroundWindow
(),
DSSCL_PRIORITY
);
ok
(
hr
==
S_OK
,
"SetCooperativeLevel failed: %08x
\n
"
,
hr
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
/* Releasing dsound from dmusic */
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
ok
(
ref
==
1
,
"dsound ref count got %d expected 1
\n
"
,
ref
);
/* Setting the same dsound twice */
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
/* Replacing one dsound with another */
hr
=
DirectSoundCreate8
(
NULL
,
(
IDirectSound8
**
)
&
dsound2
,
NULL
);
ok
(
hr
==
S_OK
,
"DirectSoundCreate failed: %08x
\n
"
,
hr
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
dsound2
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
ok
(
ref
==
1
,
"dsound ref count got %d expected 1
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
IDirectMusic_Release
(
dmusic
);
IDirectSound_Release
(
dsound
);
IDirectSound_Release
(
dsound2
);
}
static
void
test_dmbuffer
(
void
)
{
IDirectMusic
*
dmusic
;
...
...
@@ -450,6 +522,7 @@ START_TEST(dmusic)
test_COM_dmcoll
();
test_COM_synthport
();
test_dmusic
();
test_setdsound
();
test_dmbuffer
();
test_dmcoll
();
...
...
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