dmime/tests: Add refcount test for generated dmusic/dsound.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-05-11 11:05:44 +02:00 committed by Alexandre Julliard
parent 98f77c4f7c
commit 195280bee3
1 changed files with 12 additions and 0 deletions

View File

@ -122,6 +122,18 @@ static HRESULT test_InitAudio(void)
ok(hr == S_OK, "InitAudio failed: %08x\n", hr);
destroy_performance(performance, NULL, NULL);
/* Refcounts for auto generated dmusic and dsound */
create_performance(&performance, NULL, NULL, FALSE);
dmusic = NULL;
dsound = NULL;
hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, &dsound, NULL, 0, 64, 0, NULL);
ok(hr == S_OK, "InitAudio failed: %08x\n", hr);
ref = get_refcount(dsound);
todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref);
ref = get_refcount(dmusic);
ok(ref == 2, "dmusic ref count got %d expected 2\n", ref);
destroy_performance(performance, NULL, NULL);
/* dsound without SetCooperativeLevel() */
create_performance(&performance, NULL, &dsound, FALSE);
hr = IDirectMusicPerformance8_InitAudio(performance, NULL, &dsound, NULL, 0, 0, 0, NULL);