dmsynth: Add some clock tests.

oldstable
Christian Costa 2012-04-30 11:43:26 +02:00 committed by Alexandre Julliard
parent ecc369a002
commit 01e4ee0ac0
1 changed files with 21 additions and 0 deletions

View File

@ -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);