Commit 70122354 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmband/tests: Move the dll availability check to a separate function.

parent 05d18725
......@@ -31,22 +31,28 @@
DEFINE_GUID(IID_IDirectMusicBandTrackPrivate, 0x53466056, 0x6dc4, 0x11d1, 0xbf, 0x7b, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
static BOOL missing_dmband(void)
{
IDirectMusicBand *dmb;
HRESULT hr = CoCreateInstance(&CLSID_DirectMusicBand, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectMusicBand, (void**)&dmb);
if (hr == S_OK && dmb)
{
IDirectMusicBand_Release(dmb);
return FALSE;
}
return TRUE;
}
static void test_dmband(void)
{
IDirectMusicBand *band;
IUnknown *unknown = NULL;
IDirectMusicTrack *track = NULL;
IPersistStream *stream = NULL;
IPersistStream *private = NULL;
HRESULT hr;
hr = CoCreateInstance(&CLSID_DirectMusicBand, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicBand, (LPVOID*)&band);
if (hr != S_OK)
{
skip("Cannot create DirectMusicBand object (%x)\n", hr);
return;
}
hr = CoCreateInstance(&CLSID_DirectMusicBandTrack, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (LPVOID*)&unknown);
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
hr = IUnknown_QueryInterface(unknown, &IID_IDirectMusicTrack, (LPVOID*)&track);
......@@ -68,13 +74,19 @@ static void test_dmband(void)
IDirectMusicTrack_Release(track);
if (unknown)
IUnknown_Release(unknown);
IDirectMusicBand_Release(band);
}
START_TEST(dmband)
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (missing_dmband())
{
skip("dmband not available\n");
CoUninitialize();
return;
}
test_dmband();
CoUninitialize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment