mmdevapi/tests: Prevent crash when device is in use.

This commit is contained in:
Jörg Höhle 2011-11-08 19:40:59 +01:00 committed by Alexandre Julliard
parent 75dd412311
commit 7480dc0af1
2 changed files with 12 additions and 0 deletions

View File

@ -330,6 +330,8 @@ static void test_streamvolume(void)
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000,
0, fmt, NULL);
ok(hr == S_OK, "Initialize failed: %08x\n", hr);
if(hr != S_OK)
return;
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
@ -430,6 +432,8 @@ static void test_channelvolume(void)
hr = IAudioClient_GetService(ac, &IID_IChannelAudioVolume, (void**)&acv);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
if(hr != S_OK)
return;
hr = IChannelAudioVolume_GetChannelCount(acv, NULL);
ok(hr == NULL_PTR_ERR, "GetChannelCount gave wrong error: %08x\n", hr);
@ -530,6 +534,8 @@ static void test_simplevolume(void)
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav);
ok(hr == S_OK, "GetService failed: %08x\n", hr);
if(hr != S_OK)
return;
hr = ISimpleAudioVolume_GetMasterVolume(sav, NULL);
ok(hr == NULL_PTR_ERR, "GetMasterVolume gave wrong error: %08x\n", hr);
@ -621,6 +627,8 @@ static void test_volume_dependence(void)
hr = IAudioClient_GetService(ac, &IID_IAudioStreamVolume, (void**)&asv);
ok(hr == S_OK, "GetService (AudioStreamVolume) failed: %08x\n", hr);
if(hr != S_OK)
return;
hr = IAudioStreamVolume_SetChannelVolume(asv, 0, 0.2f);
ok(hr == S_OK, "ASV_SetChannelVolume failed: %08x\n", hr);

View File

@ -530,6 +530,8 @@ static void test_padding(void)
hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED,
0, 5000000, 0, pwfx, NULL);
ok(hr == S_OK, "Initialize failed: %08x\n", hr);
if(hr != S_OK)
return;
hr = IAudioClient_GetDevicePeriod(ac, &defp, &minp);
ok(hr == S_OK, "GetDevicePeriod failed: %08x\n", hr);
@ -1396,6 +1398,8 @@ static void test_session_creation(void)
NULL, (void**)&ac);
ok((hr == S_OK)^(ac == NULL), "Activate %08x &out pointer\n", hr);
ok(hr == S_OK, "Activation failed with %08x\n", hr);
if(hr != S_OK)
return;
hr = IAudioClient_GetMixFormat(ac, &fmt);
ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr);