2 * Unit test suite for IDirectMusicPerformance
4 * Copyright 2010 Austin Lund
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
24 #include <wine/test.h>
27 static IDirectMusicPerformance8 *idmusicperformance;
29 static HRESULT test_InitAudio(void)
31 IDirectSound *pDirectSound;
35 hr = IDirectMusicPerformance8_InitAudio(idmusicperformance ,NULL,
36 &pDirectSound, NULL, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL);
40 static void test_PChannelInfo(void)
42 IDirectMusicPort *pDirectMusicPort;
45 pDirectMusicPort = NULL;
46 hr = IDirectMusicPerformance8_PChannelInfo(idmusicperformance, 0, &pDirectMusicPort, NULL, NULL);
47 ok(hr == S_OK, "Failed to call PChannelInfo (%x)\n", hr);
48 ok(pDirectMusicPort != NULL, "IDirectMusicPort not set\n");
49 if (hr == S_OK && pDirectMusicPort != NULL)
50 IDirectMusicPort_Release(pDirectMusicPort);
53 static void test_GetDefaultAudioPath(void)
55 IDirectMusicAudioPath *pDirectMusicAudioPath;
58 hr = IDirectMusicPerformance8_GetDefaultAudioPath(idmusicperformance, &pDirectMusicAudioPath);
59 ok(hr == S_OK, "Failed to call GetDefaultAudioPath (%x)\n", hr);
61 IDirectMusicAudioPath_Release(pDirectMusicAudioPath);
64 static void test_CloseDown(void)
68 hr = IDirectMusicPerformance8_CloseDown(idmusicperformance);
69 ok(hr == S_OK, "Failed to call CloseDown (%x)\n", hr);
72 START_TEST( performance )
76 hr = CoInitialize(NULL);
78 skip("Cannot initialize COM (%x)\n", hr);
82 hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL,
83 CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8, (LPVOID *)&idmusicperformance);
85 skip("Cannot create DirectMusicPerformance object (%x)\n", hr);
90 hr = test_InitAudio();
92 skip("InitAudio failed (%x)\n", hr);
96 test_GetDefaultAudioPath();
100 IDirectMusicPerformance8_Release(idmusicperformance);