From: Matteo Bruni mbruni@codeweavers.com
It was handling unexpected behavior while ok() checks would have failed anyway. I don't see this particular behavior in recent test.winehq.org results let's get rid of the extra code for now.
Partially reverts 8e62e823d6a41f40d1b50c5a77083290f525bb0c. --- dlls/mmdevapi/tests/render.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-)
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 93c5f51e7d4..ec6fcacdff3 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -1609,7 +1609,6 @@ static void test_session(void) hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ses1_ac1); ok(hr == S_OK, "Activation failed with %08lx\n", hr); - if (FAILED(hr)) return;
hr = IAudioClient_GetMixFormat(ses1_ac1, &pwfx); ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); @@ -1618,19 +1617,9 @@ static void test_session(void) 0, 5000000, 0, pwfx, &ses1_guid); ok(hr == S_OK, "Initialize failed: %08lx\n", hr);
- if(hr == S_OK){ - hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, - NULL, (void**)&ses1_ac2); - ok(hr == S_OK, "Activation failed with %08lx\n", hr); - } - if(hr != S_OK){ - skip("Unable to open the same device twice. Skipping session tests\n"); - - ref = IAudioClient_Release(ses1_ac1); - ok(ref == 0, "AudioClient wasn't released: %lu\n", ref); - CoTaskMemFree(pwfx); - return; - } + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ses1_ac2); + ok(hr == S_OK, "Activation failed with %08lx\n", hr);
hr = IAudioClient_Initialize(ses1_ac2, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, &ses1_guid); @@ -1641,7 +1630,6 @@ static void test_session(void) if(hr == S_OK){ hr = IMMDevice_Activate(cap_dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_ac); - ok((hr == S_OK)^(cap_ac == NULL), "Activate %08lx &out pointer\n", hr); ok(hr == S_OK, "Activate failed: %08lx\n", hr); IMMDevice_Release(cap_dev); } @@ -2349,7 +2337,6 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&sesm); - ok((hr == S_OK)^(sesm == NULL), "Activate %08lx &out pointer\n", hr); ok(hr == S_OK, "Activate failed: %08lx\n", hr);
hr = IAudioSessionManager_GetSimpleAudioVolume(sesm, &session_guid, @@ -2474,7 +2461,6 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(cap_dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_sesm); - ok((hr == S_OK)^(cap_sesm == NULL), "Activate %08lx &out pointer\n", hr); ok(hr == S_OK, "Activate failed: %08lx\n", hr);
hr = IAudioSessionManager_GetAudioSessionControl(cap_sesm, &session_guid, FALSE, &cap_sesc); @@ -2521,10 +2507,7 @@ static void test_session_creation(void)
hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac); - ok((hr == S_OK)^(ac == NULL), "Activate %08lx &out pointer\n", hr); ok(hr == S_OK, "Activation failed with %08lx\n", hr); - if(hr != S_OK) - return;
hr = IAudioClient_GetMixFormat(ac, &fmt); ok(hr == S_OK, "GetMixFormat failed: %08lx\n", hr); @@ -2535,14 +2518,12 @@ static void test_session_creation(void)
hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav); ok(hr == S_OK, "GetService failed: %08lx\n", hr); - if(hr == S_OK){ - vol = 0.5f; - hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); - ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); - ok(fabs(vol - 0.6f) < 0.05f, "Got wrong volume: %f\n", vol); + vol = 0.5f; + hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); + ok(hr == S_OK, "GetMasterVolume failed: %08lx\n", hr); + ok(fabs(vol - 0.6f) < 0.05f, "Got wrong volume: %f\n", vol);
- ISimpleAudioVolume_Release(sav); - } + ISimpleAudioVolume_Release(sav);
CoTaskMemFree(fmt); IAudioClient_Release(ac);