2 * Unit tests for dmband functions
4 * Copyright (C) 2012 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/test.h"
32 DEFINE_GUID(IID_IDirectMusicBandTrackPrivate
, 0x53466056, 0x6dc4, 0x11d1, 0xbf, 0x7b, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
34 static BOOL
missing_dmband(void)
36 IDirectMusicBand
*dmb
;
37 HRESULT hr
= CoCreateInstance(&CLSID_DirectMusicBand
, NULL
, CLSCTX_INPROC_SERVER
,
38 &IID_IDirectMusicBand
, (void**)&dmb
);
40 if (hr
== S_OK
&& dmb
)
42 IDirectMusicBand_Release(dmb
);
48 static void test_dmband(void)
50 IUnknown
*unknown
= NULL
;
51 IDirectMusicTrack
*track
= NULL
;
52 IPersistStream
*stream
= NULL
;
53 IPersistStream
*private = NULL
;
56 hr
= CoCreateInstance(&CLSID_DirectMusicBandTrack
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IUnknown
, (LPVOID
*)&unknown
);
57 ok(hr
== S_OK
, "CoCreateInstance returned: %x\n", hr
);
58 hr
= IUnknown_QueryInterface(unknown
, &IID_IDirectMusicTrack
, (LPVOID
*)&track
);
59 ok(hr
== S_OK
, "QueryInterface returned: %x\n", hr
);
60 todo_wine
ok((LPVOID
)track
== (LPVOID
)unknown
, "Interface are not the same %p != %p\n", stream
, private);
61 hr
= IUnknown_QueryInterface(unknown
, &IID_IPersistStream
, (LPVOID
*)&stream
);
62 ok(hr
== S_OK
, "QueryInterface returned: %x\n", hr
);
63 /* Query private interface */
64 hr
= IUnknown_QueryInterface(unknown
, &IID_IDirectMusicBandTrackPrivate
, (LPVOID
*)&private);
65 todo_wine
ok(hr
== S_OK
, "QueryInterface returned: %x\n", hr
);
67 trace("Interfaces: unknown = %p, track = %p, stream = %p, private = %p\n", unknown
, track
, stream
, private);
70 IPersistStream_Release(private);
72 IPersistStream_Release(stream
);
74 IDirectMusicTrack_Release(track
);
76 IUnknown_Release(unknown
);
81 CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
85 skip("dmband not available\n");