Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
e236a3c2
Commit
e236a3c2
authored
12 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dsound/tests: Add IDirectSound refcount and COM aggregation tests.
parent
1ba96882
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/dsound/tests/dsound.c
+7
-1
7 additions, 1 deletion
dlls/dsound/tests/dsound.c
dlls/dsound/tests/dsound8.c
+51
-0
51 additions, 0 deletions
dlls/dsound/tests/dsound8.c
with
58 additions
and
1 deletion
dlls/dsound/tests/dsound.c
+
7
−
1
View file @
e236a3c2
...
...
@@ -173,7 +173,7 @@ EXIT:
static
void
IDirectSound_tests
(
void
)
{
HRESULT
rc
;
LPDIRECTSOUND
dso
=
NULL
;
IDirectSound
*
dso
=
(
IDirectSound
*
)
0xdeadbeef
;
LPCLASSFACTORY
cf
=
NULL
;
trace
(
"Testing IDirectSound
\n
"
);
...
...
@@ -188,6 +188,12 @@ static void IDirectSound_tests(void)
ok
(
rc
==
S_OK
,
"CoGetClassObject(CLSID_DirectSound, IID_IUnknown) "
"failed: %08x
\n
"
,
rc
);
/* COM aggregation */
rc
=
CoCreateInstance
(
&
CLSID_DirectSound
,
(
IUnknown
*
)
&
dso
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound
,
(
void
**
)
&
dso
);
ok
(
rc
==
CLASS_E_NOAGGREGATION
||
broken
(
rc
==
DSERR_INVALIDPARAM
),
"DirectMusicPerformance create failed: %08x, expected CLASS_E_NOAGGREGATION
\n
"
,
rc
);
/* try the COM class factory method of creation with no device specified */
rc
=
CoCreateInstance
(
&
CLSID_DirectSound
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound
,
(
void
**
)
&
dso
);
...
...
This diff is collapsed.
Click to expand it.
dlls/dsound/tests/dsound8.c
+
51
−
0
View file @
e236a3c2
...
...
@@ -1116,6 +1116,56 @@ static void test_first_device(void)
ok
(
hr
==
S_OK
,
"DirectSoundEnumerateA failed: %08x
\n
"
,
hr
);
}
static
void
test_COM
(
void
)
{
IDirectSound
*
ds
;
IDirectSound8
*
ds8
=
(
IDirectSound8
*
)
0xdeadbeef
;
IUnknown
*
unk
,
*
unk8
;
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_DirectSound8
,
(
IUnknown
*
)
&
ds
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
ds8
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectSound create failed: %08x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
ds8
,
"ds8 = %p
\n
"
,
ds8
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectSound8
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound3DBuffer
,
(
void
**
)
&
ds8
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectSound create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for IDirectSound and IDirectSound8 */
hr
=
CoCreateInstance
(
&
CLSID_DirectSound8
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound8
,
(
void
**
)
&
ds8
);
ok
(
hr
==
S_OK
,
"DirectSound create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectSound8_AddRef
(
ds8
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IDirectSound8_QueryInterface
(
ds8
,
&
IID_IDirectSound
,
(
void
**
)
&
ds
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IDirectSound failed: %08x
\n
"
,
hr
);
refcount
=
IDirectSound8_AddRef
(
ds8
);
todo_wine
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
refcount
=
IDirectSound_AddRef
(
ds
);
todo_wine
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
/* Separate refcount for IUnknown */
hr
=
IDirectSound_QueryInterface
(
ds
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IDirectSound_QueryInterface
(
ds8
,
&
IID_IUnknown
,
(
void
**
)
&
unk8
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk8
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
refcount
=
IDirectSound_AddRef
(
ds
);
todo_wine
ok
(
refcount
==
6
,
"refcount == %u, expected 6
\n
"
,
refcount
);
while
(
IDirectSound_Release
(
ds
));
while
(
IUnknown_Release
(
unk
));
}
START_TEST
(
dsound8
)
{
HMODULE
hDsound
;
...
...
@@ -1132,6 +1182,7 @@ START_TEST(dsound8)
"DirectSoundCreate8"
);
if
(
pDirectSoundCreate8
)
{
test_COM
();
IDirectSound8_tests
();
dsound8_tests
();
test_hw_buffers
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment