ddraw: Use wined3d_get_adapter_display_mode() in ddraw7_GetFourCCCodes().
[wine/multimedia.git] / dlls / dmband / tests / dmband.c
blobecc767a159050923ccc5e813f39d66e589313e44
1 /*
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
21 #define COBJMACROS
23 #include <stdio.h>
25 #include "wine/test.h"
26 #include "uuids.h"
27 #include "ole2.h"
28 #include "initguid.h"
29 #include "dmusici.h"
30 #include "dmplugin.h"
32 DEFINE_GUID(IID_IDirectMusicBandTrackPrivate, 0x53466056, 0x6dc4, 0x11d1, 0xbf, 0x7b, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
34 static void test_dmband(void)
36 IDirectMusicBand *band;
37 IUnknown *unknown = NULL;
38 IDirectMusicTrack *track = NULL;
39 IPersistStream *stream = NULL;
40 IPersistStream *private = NULL;
41 HRESULT hr;
43 hr = CoCreateInstance(&CLSID_DirectMusicBand, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicBand, (LPVOID*)&band);
44 if (hr != S_OK)
46 skip("Cannot create DirectMusicBand object (%x)\n", hr);
47 return;
50 hr = CoCreateInstance(&CLSID_DirectMusicBandTrack, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (LPVOID*)&unknown);
51 ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
52 hr = IUnknown_QueryInterface(unknown, &IID_IDirectMusicTrack, (LPVOID*)&track);
53 ok(hr == S_OK, "QueryInterface returned: %x\n", hr);
54 todo_wine ok((LPVOID)track == (LPVOID)unknown, "Interface are not the same %p != %p\n", stream, private);
55 hr = IUnknown_QueryInterface(unknown, &IID_IPersistStream, (LPVOID*)&stream);
56 ok(hr == S_OK, "QueryInterface returned: %x\n", hr);
57 /* Query private interface */
58 hr = IUnknown_QueryInterface(unknown, &IID_IDirectMusicBandTrackPrivate, (LPVOID*)&private);
59 todo_wine ok(hr == S_OK, "QueryInterface returned: %x\n", hr);
61 trace("Interfaces: unknown = %p, track = %p, stream = %p, private = %p\n", unknown, track, stream, private);
63 if (private)
64 IPersistStream_Release(private);
65 if (stream)
66 IPersistStream_Release(stream);
67 if (track)
68 IDirectMusicTrack_Release(track);
69 if (unknown)
70 IUnknown_Release(unknown);
71 IDirectMusicBand_Release(band);
74 START_TEST(dmband)
76 CoInitializeEx(NULL, COINIT_MULTITHREADED);
78 test_dmband();
80 CoUninitialize();