From 65488e6cf181d28e091debfe76899ffafbdbdfb7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 8 Nov 2019 13:26:30 -0600 Subject: [PATCH] dsound/tests: Add media object query tests. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/dsound/tests/dsound8.c | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index b66275973f7..8190a617368 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -1424,6 +1424,38 @@ static void test_effects(void) while (IDirectSound8_Release(dso)); } +static void test_dsfx_interfaces(const char *test_prefix, IUnknown *dmo, REFGUID refguid) +{ + HRESULT rc; + IMediaObject *mediaobject; + IMediaObjectInPlace *inplace; + IUnknown *parent; + + rc = IUnknown_QueryInterface(dmo, &IID_IMediaObject, (void**)&mediaobject); + ok(rc == DS_OK, "%s: Failed: %08x\n", test_prefix, rc); + if (rc == DS_OK) + { + rc = IMediaObject_QueryInterface(mediaobject, refguid, (void**)&parent); + ok(rc == S_OK, "%s: got: %08x\n", test_prefix, rc); + ok(dmo == parent, "%s: Objects not equal\n", test_prefix); + IUnknown_Release(parent); + + IMediaObject_Release(mediaobject); + } + + rc = IUnknown_QueryInterface(dmo, &IID_IMediaObjectInPlace, (void**)&inplace); + ok(rc == DS_OK, "%s: Failed: %08x\n", test_prefix, rc); + if (rc == DS_OK) + { + rc = IMediaObjectInPlace_QueryInterface(inplace, refguid, (void**)&parent); + ok(rc == S_OK, "%s: got: %08x\n", test_prefix, rc); + ok(dmo == parent, "%s: Objects not equal\n", test_prefix); + IUnknown_Release(parent); + + IMediaObjectInPlace_Release(inplace); + } +} + static void test_echo_parameters(IDirectSoundBuffer8 *secondary8) { HRESULT rc; @@ -1446,6 +1478,8 @@ static void test_echo_parameters(IDirectSoundBuffer8 *secondary8) ok(params.lPanDelay == 0, "got %d\n", params.lPanDelay); } + test_dsfx_interfaces("FXEcho", (IUnknown *)echo, &IID_IDirectSoundFXEcho); + IDirectSoundFXEcho_Release(echo); } } @@ -1469,6 +1503,8 @@ static void test_gargle_parameters(IDirectSoundBuffer8 *secondary8) ok(params.dwWaveShape == DSFXGARGLE_WAVE_TRIANGLE, "got %d\n", params.dwWaveShape); } + test_dsfx_interfaces("FXGargle", (IUnknown *)gargle, &IID_IDirectSoundFXGargle); + IDirectSoundFXGargle_Release(gargle); } } @@ -1497,6 +1533,8 @@ static void test_chorus_parameters(IDirectSoundBuffer8 *secondary8) ok(params.lPhase == 3, "got %d\n", params.lPhase); } + test_dsfx_interfaces("FXChorus", (IUnknown *)chorus, &IID_IDirectSoundFXChorus); + IDirectSoundFXChorus_Release(chorus); } } @@ -1525,6 +1563,8 @@ static void test_flanger_parameters(IDirectSoundBuffer8 *secondary8) ok(params.lPhase == 2, "got %d\n", params.lPhase); } + test_dsfx_interfaces("FXFlanger", (IUnknown *)flanger, &IID_IDirectSoundFXFlanger); + IDirectSoundFXFlanger_Release(flanger); } } @@ -1551,6 +1591,8 @@ static void test_distortion_parameters(IDirectSoundBuffer8 *secondary8) ok(params.fPreLowpassCutoff == 3675.0f, "got %f\n", params.fPreLowpassCutoff); } + test_dsfx_interfaces("FXDistortion", (IUnknown *)distortion, &IID_IDirectSoundFXDistortion); + IDirectSoundFXDistortion_Release(distortion); } } @@ -1577,6 +1619,8 @@ static void test_compressor_parameters(IDirectSoundBuffer8 *secondary8) ok(params.fPredelay == 4.0f, "got %f\n", params.fPredelay); } + test_dsfx_interfaces("FXCompressor", (IUnknown *)compressor, &IID_IDirectSoundFXCompressor); + IDirectSoundFXCompressor_Release(compressor); } } @@ -1601,6 +1645,8 @@ static void test_parameq_parameters(IDirectSoundBuffer8 *secondary8) ok(params.fGain == 0.0f, "got %f\n", params.fGain); } + test_dsfx_interfaces("FXParamEq", (IUnknown *)parameq, &IID_IDirectSoundFXParamEq); + IDirectSoundFXParamEq_Release(parameq); } } @@ -1632,6 +1678,8 @@ static void test_reverb_parameters(IDirectSoundBuffer8 *secondary8) ok(params.flHFReference == 5000.0f, "got %f\n", params.flHFReference); } + test_dsfx_interfaces("FXI3DL2Reverb", (IUnknown *)reverb, &IID_IDirectSoundFXI3DL2Reverb); + IDirectSoundFXI3DL2Reverb_Release(reverb); } }