From 485277dd67ae4bdc2d447c5ad58588cc7d6533cc Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 5 Jun 2016 19:34:02 +0000 Subject: [PATCH] [MMDEVAPI_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 svn path=/trunk/; revision=71564 --- rostests/winetests/mmdevapi/propstore.c | 2 +- rostests/winetests/mmdevapi/render.c | 52 +++++++++++++++++++++---- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/rostests/winetests/mmdevapi/propstore.c b/rostests/winetests/mmdevapi/propstore.c index 06fe6900f17..665136f7d40 100644 --- a/rostests/winetests/mmdevapi/propstore.c +++ b/rostests/winetests/mmdevapi/propstore.c @@ -173,7 +173,7 @@ static void test_setvalue_on_wow64(IPropertyStore *store) /* Note: the registry key exists even without calling IPropStore::Commit */ size = sizeof(regval); - ret = RegGetValueW(props, NULL, bogusW, RRF_RT_DWORD, &type, ®val, &size); + ret = RegQueryValueExW(props, bogusW, NULL, &type, (LPBYTE)®val, &size); ok(ret == ERROR_SUCCESS, "Couldn't get bogus propertykey value: %u\n", ret); ok(type == REG_DWORD, "Got wrong value type: %u\n", type); ok(regval == 0xAB, "Got wrong value: 0x%x\n", regval); diff --git a/rostests/winetests/mmdevapi/render.c b/rostests/winetests/mmdevapi/render.c index 298c886c7a3..03efc4e7d3b 100644 --- a/rostests/winetests/mmdevapi/render.c +++ b/rostests/winetests/mmdevapi/render.c @@ -29,16 +29,14 @@ #define COBJMACROS -#ifdef STANDALONE -#include "initguid.h" -#endif - #include "unknwn.h" #include "uuids.h" #include "mmdeviceapi.h" #include "mmsystem.h" #include "audioclient.h" #include "audiopolicy.h" +#include "initguid.h" +#include "endpointvolume.h" static const unsigned int win_formats[][4] = { { 8000, 8, 1}, { 8000, 8, 2}, { 8000, 16, 1}, { 8000, 16, 2}, @@ -729,7 +727,7 @@ static void test_padding(void) ok(defp == 100000 || broken(defp == 101587) || defp == 200000, "Expected 10ms default period: %u\n", (ULONG)defp); ok(minp != 0, "Minimum period is 0\n"); - ok(minp <= defp, "Mininum period is greater than default period\n"); + ok(minp <= defp, "Minimum period is greater than default period\n"); hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&arc); ok(hr == S_OK, "GetService failed: %08x\n", hr); @@ -951,8 +949,9 @@ static void test_clock(int share) ok(gbsize == bufsize, "BufferSize %u at rate %u\n", gbsize, pwfx->nSamplesPerSec); else - ok(gbsize == parts * fragment || gbsize == MulDiv(bufsize, 1, 1024) * 1024, - "BufferSize %u misfits fragment size %u at rate %u\n", gbsize, fragment, pwfx->nSamplesPerSec); + todo_wine + ok(gbsize == parts * fragment || gbsize == MulDiv(bufsize, 1, 1024) * 1024, + "BufferSize %u misfits fragment size %u at rate %u\n", gbsize, fragment, pwfx->nSamplesPerSec); /* In shared mode, GetCurrentPadding decreases in multiples of * fragment size (i.e. updated only at period ticks), whereas @@ -2242,6 +2241,44 @@ static void test_marshal(void) } +static void test_endpointvolume(void) +{ + HRESULT hr; + IAudioEndpointVolume *aev; + float mindb, maxdb, increment, volume; + BOOL mute; + + hr = IMMDevice_Activate(dev, &IID_IAudioEndpointVolume, + CLSCTX_INPROC_SERVER, NULL, (void**)&aev); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioEndpointVolume_GetVolumeRange(aev, &mindb, NULL, NULL); + ok(hr == E_POINTER, "GetVolumeRange should have failed with E_POINTER: 0x%08x\n", hr); + + hr = IAudioEndpointVolume_GetVolumeRange(aev, &mindb, &maxdb, &increment); + ok(hr == S_OK, "GetVolumeRange failed: 0x%08x\n", hr); + trace("got range: [%f,%f]/%f\n", mindb, maxdb, increment); + + hr = IAudioEndpointVolume_SetMasterVolumeLevel(aev, mindb - increment, NULL); + ok(hr == E_INVALIDARG, "SetMasterVolumeLevel failed: 0x%08x\n", hr); + + hr = IAudioEndpointVolume_GetMasterVolumeLevel(aev, &volume); + ok(hr == S_OK, "GetMasterVolumeLevel failed: 0x%08x\n", hr); + + hr = IAudioEndpointVolume_SetMasterVolumeLevel(aev, volume, NULL); + ok(hr == S_OK, "SetMasterVolumeLevel failed: 0x%08x\n", hr); + + hr = IAudioEndpointVolume_GetMute(aev, &mute); + ok(hr == S_OK, "GetMute failed: %08x\n", hr); + + hr = IAudioEndpointVolume_SetMute(aev, mute, NULL); + ok(hr == S_OK || hr == S_FALSE, "SetMute failed: %08x\n", hr); + + IAudioEndpointVolume_Release(aev); +} + START_TEST(render) { HRESULT hr; @@ -2283,6 +2320,7 @@ START_TEST(render) test_volume_dependence(); test_session_creation(); test_worst_case(); + test_endpointvolume(); IMMDevice_Release(dev);