[PATCH 2/3] dmsynth: Add some clock tests.
Christian Costa
titan.costa at gmail.com
Mon Apr 30 04:43:26 CDT 2012
---
dlls/dmsynth/tests/dmsynth.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c
index b341935..161018e 100644
--- a/dlls/dmsynth/tests/dmsynth.c
+++ b/dlls/dmsynth/tests/dmsynth.c
@@ -33,6 +33,8 @@ static void test_dmsynth(void)
{
IDirectMusicSynth *dmsynth = NULL;
IDirectMusicSynthSink *dmsynth_sink = NULL;
+ IReferenceClock* clock = NULL;
+ IReferenceClock* clock_sink = NULL;
HRESULT hr;
hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth);
@@ -45,6 +47,25 @@ static void test_dmsynth(void)
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (LPVOID*)&dmsynth_sink);
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
+ /* Synth has no default clock */
+ hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock);
+ todo_wine ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+
+ /* SynthSink has a default clock */
+ hr = IDirectMusicSynthSink_GetLatencyClock(dmsynth_sink, &clock_sink);
+ ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+ todo_wine ok(clock_sink != NULL, "No clock returned\n");
+
+ /* This will set clock to Synth */
+ hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
+ ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
+
+ /* Check clocks are the same */
+ hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock);
+ ok(hr == S_OK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
+ todo_wine ok(clock != NULL, "No clock returned\n");
+ ok(clock == clock_sink, "Synth and SynthSink clocks are not the same\n");
+
if (dmsynth_sink)
IDirectMusicSynthSink_Release(dmsynth_sink);
IDirectMusicSynth_Release(dmsynth);
More information about the wine-patches
mailing list