Skip to content

Commit

Permalink
dsdmo/tests: Add IMediaParamInfo tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
  • Loading branch information
zzhiyi authored and julliard committed Jul 20, 2022
1 parent 4e23e41 commit 208a8aa
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions dlls/dsdmo/tests/dsdmo.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "mmsystem.h"
#include "dmo.h"
#include "initguid.h"
#include "medparam.h"
#include "dsound.h"
#include "uuids.h"
#include "wine/test.h"
Expand Down Expand Up @@ -131,28 +132,41 @@ static void test_aggregation(const GUID *clsid)

static void test_interfaces(const GUID *clsid, const GUID *iid)
{
static const GUID *guids[] =
{
&IID_IMediaObject,
&IID_IMediaObjectInPlace,
&IID_IMediaParamInfo,
};
IUnknown *unk, *unk2, *unk3;
unsigned int i;
HRESULT hr;
ULONG ref;

hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, (void **)&unk);
ok(hr == S_OK, "Got hr %#lx.\n", hr);

hr = IUnknown_QueryInterface(unk, &IID_IMediaObject, (void **)&unk2);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk3 == unk, "Interface pointers didn't match.\n");
IUnknown_Release(unk3);
IUnknown_Release(unk2);
for (i = 0; i < ARRAY_SIZE(guids); ++i)
{
winetest_push_context("GUID %s", debugstr_guid(guids[i]));

hr = IUnknown_QueryInterface(unk, &IID_IMediaObjectInPlace, (void **)&unk2);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk3 == unk, "Interface pointers didn't match.\n");
IUnknown_Release(unk3);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, guids[i], (void **)&unk2);
todo_wine_if(guids[i] == &IID_IMediaParamInfo)
ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr != S_OK)
{
winetest_pop_context();
continue;
}

hr = IUnknown_QueryInterface(unk2, iid, (void **)&unk3);
ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk3 == unk, "Interface pointers didn't match.\n");
IUnknown_Release(unk3);
IUnknown_Release(unk2);

winetest_pop_context();
}

ref = IUnknown_Release(unk);
ok(!ref, "Got outstanding refcount %ld.\n", ref);
Expand Down

0 comments on commit 208a8aa

Please sign in to comment.