dmsynth/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8cfe529a59
commit
fe1aebb600
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = dmsynth.dll
|
||||
IMPORTS = oleaut32 ole32 uuid
|
||||
|
||||
|
|
|
@ -67,81 +67,81 @@ static void test_dmsynth(void)
|
|||
DMUS_PORTCAPS caps;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink,
|
||||
(void **)&dmsynth_sink);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink,
|
||||
(void **)&dmsynth_sink2);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
|
||||
ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr);
|
||||
|
||||
hr = IDirectMusicSynth_QueryInterface(dmsynth, &IID_IKsControl, (LPVOID*)&control_synth);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %#lx\n", hr);
|
||||
|
||||
S(U(property)).Id = 0;
|
||||
S(U(property)).Flags = KSPROPERTY_TYPE_GET;
|
||||
|
||||
S(U(property)).Set = GUID_DMUS_PROP_INSTRUMENT2;
|
||||
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %u, should be 1\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %lu, should be 1\n", value);
|
||||
S(U(property)).Set = GUID_DMUS_PROP_DLS2;
|
||||
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %u, should be 1\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %lu, should be 1\n", value);
|
||||
S(U(property)).Set = GUID_DMUS_PROP_GM_Hardware;
|
||||
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %u, should be 0\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %lu, should be 0\n", value);
|
||||
S(U(property)).Set = GUID_DMUS_PROP_GS_Hardware;
|
||||
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %u, should be 0\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %lu, should be 0\n", value);
|
||||
S(U(property)).Set = GUID_DMUS_PROP_XG_Hardware;
|
||||
hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %u, should be 0\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == FALSE, "Return value: %lu, should be 0\n", value);
|
||||
|
||||
hr = IDirectMusicSynthSink_QueryInterface(dmsynth_sink, &IID_IKsControl, (LPVOID*)&control_sink);
|
||||
ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %#lx\n", hr);
|
||||
|
||||
S(U(property)).Set = GUID_DMUS_PROP_SinkUsesDSound;
|
||||
hr = IKsControl_KsProperty(control_sink, &property, sizeof(property), &value, sizeof(value), &bytes);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %u, should be 1\n", value);
|
||||
ok(hr == S_OK, "IKsControl_KsProperty returned: %#lx\n", hr);
|
||||
ok(bytes == sizeof(DWORD), "Returned bytes: %lu, should be 4\n", bytes);
|
||||
ok(value == TRUE, "Return value: %lu, should be 1\n", value);
|
||||
|
||||
/* Synth isn't fully initialized yet */
|
||||
hr = IDirectMusicSynth_Activate(dmsynth, TRUE);
|
||||
ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %x\n", hr);
|
||||
ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %#lx\n", hr);
|
||||
|
||||
/* Synth has no default clock */
|
||||
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
|
||||
ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
|
||||
ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
|
||||
|
||||
/* SynthSink has a default clock */
|
||||
hr = IDirectMusicSynthSink_GetLatencyClock(dmsynth_sink, &clock_sink);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
|
||||
ok(clock_sink != NULL, "No clock returned\n");
|
||||
ref_clock_sink = get_refcount(clock_sink);
|
||||
|
||||
/* This will Init() the SynthSink and finish initializing the Synth */
|
||||
hr = IDirectMusicSynthSink_Init(dmsynth_sink2, NULL);
|
||||
ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %#lx\n", hr);
|
||||
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %#lx\n", hr);
|
||||
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %#lx\n", hr);
|
||||
|
||||
/* Check clocks are the same */
|
||||
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
|
||||
ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %#lx\n", hr);
|
||||
ok(clock_synth != NULL, "No clock returned\n");
|
||||
ok(clock_synth == clock_sink, "Synth and SynthSink clocks are not the same\n");
|
||||
ref_clock_synth = get_refcount(clock_synth);
|
||||
|
@ -149,13 +149,13 @@ static void test_dmsynth(void)
|
|||
|
||||
/* GetPortCaps */
|
||||
hr = IDirectMusicSynth_GetPortCaps(dmsynth, NULL);
|
||||
ok(hr == E_INVALIDARG, "GetPortCaps failed: %#x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "GetPortCaps failed: %#lx\n", hr);
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
hr = IDirectMusicSynth_GetPortCaps(dmsynth, &caps);
|
||||
ok(hr == E_INVALIDARG, "GetPortCaps failed: %#x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "GetPortCaps failed: %#lx\n", hr);
|
||||
caps.dwSize = sizeof(caps) + 1;
|
||||
hr = IDirectMusicSynth_GetPortCaps(dmsynth, &caps);
|
||||
ok(hr == S_OK, "GetPortCaps failed: %#x\n", hr);
|
||||
ok(hr == S_OK, "GetPortCaps failed: %#lx\n", hr);
|
||||
|
||||
if (control_synth)
|
||||
IDirectMusicSynth_Release(control_synth);
|
||||
|
@ -184,38 +184,38 @@ static void test_COM(void)
|
|||
hr = CoCreateInstance(&CLSID_DirectMusicSynth, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
||||
&IID_IUnknown, (void**)&dms8);
|
||||
ok(hr == CLASS_E_NOAGGREGATION,
|
||||
"DirectMusicSynth create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
|
||||
"DirectMusicSynth create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
||||
ok(!dms8, "dms8 = %p\n", dms8);
|
||||
|
||||
/* Invalid RIID */
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectMusicObject, (void**)&dms8);
|
||||
ok(hr == E_NOINTERFACE, "DirectMusicSynth create failed: %08x, expected E_NOINTERFACE\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "DirectMusicSynth create failed: %#lx, expected E_NOINTERFACE\n", hr);
|
||||
|
||||
/* Same refcount for all DirectMusicSynth interfaces */
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectMusicSynth8, (void**)&dms8);
|
||||
ok(hr == S_OK, "DirectMusicSynth create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "DirectMusicSynth create failed: %#lx, expected S_OK\n", hr);
|
||||
refcount = IDirectMusicSynth8_AddRef(dms8);
|
||||
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
|
||||
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
||||
|
||||
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IKsControl, (void**)&iksc);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %#lx\n", hr);
|
||||
refcount = IKsControl_AddRef(iksc);
|
||||
ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
|
||||
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
||||
IKsControl_Release(iksc);
|
||||
|
||||
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IUnknown, (void**)&unk);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
||||
refcount = IUnknown_AddRef(unk);
|
||||
ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
|
||||
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
/* Unsupported interfaces */
|
||||
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IDirectMusicSynthSink, (void**)&unk);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSynthSink failed: %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSynthSink failed: %#lx\n", hr);
|
||||
hr = IDirectMusicSynth8_QueryInterface(dms8, &IID_IReferenceClock, (void**)&unk);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %#lx\n", hr);
|
||||
|
||||
while (IDirectMusicSynth8_Release(dms8));
|
||||
}
|
||||
|
@ -232,36 +232,36 @@ static void test_COM_synthsink(void)
|
|||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
||||
&IID_IUnknown, (void**)&dmss);
|
||||
ok(hr == CLASS_E_NOAGGREGATION,
|
||||
"DirectMusicSynthSink create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr);
|
||||
"DirectMusicSynthSink create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
||||
ok(!dmss, "dmss = %p\n", dmss);
|
||||
|
||||
/* Invalid RIID */
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectMusicObject, (void**)&dmss);
|
||||
ok(hr == E_NOINTERFACE, "DirectMusicSynthSink create failed: %08x, expected E_NOINTERFACE\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "DirectMusicSynthSink create failed: %#lx, expected E_NOINTERFACE\n", hr);
|
||||
|
||||
/* Same refcount for all DirectMusicSynthSink interfaces */
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectMusicSynthSink, (void**)&dmss);
|
||||
ok(hr == S_OK, "DirectMusicSynthSink create failed: %08x, expected S_OK\n", hr);
|
||||
ok(hr == S_OK, "DirectMusicSynthSink create failed: %#lx, expected S_OK\n", hr);
|
||||
refcount = IDirectMusicSynthSink_AddRef(dmss);
|
||||
ok(refcount == 2, "refcount == %u, expected 2\n", refcount);
|
||||
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
||||
|
||||
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IKsControl, (void**)&iksc);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IKsControl failed: %#lx\n", hr);
|
||||
refcount = IKsControl_AddRef(iksc);
|
||||
ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
|
||||
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
||||
IKsControl_Release(iksc);
|
||||
|
||||
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IUnknown, (void**)&unk);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
||||
refcount = IUnknown_AddRef(unk);
|
||||
ok(refcount == 5, "refcount == %u, expected 5\n", refcount);
|
||||
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
/* Unsupported interfaces */
|
||||
hr = IDirectMusicSynthSink_QueryInterface(dmss, &IID_IReferenceClock, (void**)&unk);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IReferenceClock failed: %#lx\n", hr);
|
||||
|
||||
while (IDirectMusicSynthSink_Release(dmss));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue