Module: wine Branch: master Commit: 01e4ee0ac0515b9c9e2fb409bdcee355f54e0d86 URL: http://source.winehq.org/git/wine.git/?a=commit;h=01e4ee0ac0515b9c9e2fb409bd...
Author: Christian Costa titan.costa@gmail.com Date: Mon Apr 30 11:43:26 2012 +0200
dmsynth: Add some clock tests.
---
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);