dmime/tests: Added tests for IDirectMusicPerformance.
This commit is contained in:
parent
d6c9c7a08b
commit
203272eafa
|
@ -14499,6 +14499,7 @@ wine_fn_config_dll display.drv16 enable_win16
|
|||
wine_fn_config_dll dmband enable_dmband
|
||||
wine_fn_config_dll dmcompos enable_dmcompos
|
||||
wine_fn_config_dll dmime enable_dmime
|
||||
wine_fn_config_test dlls/dmime/tests dmime_test
|
||||
wine_fn_config_dll dmloader enable_dmloader
|
||||
wine_fn_config_test dlls/dmloader/tests dmloader_test
|
||||
wine_fn_config_dll dmscript enable_dmscript
|
||||
|
|
|
@ -2338,6 +2338,7 @@ WINE_CONFIG_DLL(display.drv16,enable_win16)
|
|||
WINE_CONFIG_DLL(dmband)
|
||||
WINE_CONFIG_DLL(dmcompos)
|
||||
WINE_CONFIG_DLL(dmime)
|
||||
WINE_CONFIG_TEST(dlls/dmime/tests)
|
||||
WINE_CONFIG_DLL(dmloader)
|
||||
WINE_CONFIG_TEST(dlls/dmloader/tests)
|
||||
WINE_CONFIG_DLL(dmscript)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
TESTDLL = dmime.dll
|
||||
IMPORTS = user32 ole32
|
||||
|
||||
C_SRCS = \
|
||||
performance.c
|
||||
|
||||
@MAKE_TEST_RULES@
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Unit test suite for IDirectMusicPerformance
|
||||
*
|
||||
* Copyright 2010 Austin Lund
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <initguid.h>
|
||||
#include <wine/test.h>
|
||||
#include <dmusici.h>
|
||||
|
||||
IDirectMusicPerformance8 *idmusicperformance;
|
||||
|
||||
static HRESULT test_InitAudio(void)
|
||||
{
|
||||
IDirectSound *pDirectSound;
|
||||
HRESULT hr;
|
||||
|
||||
pDirectSound = NULL;
|
||||
hr = IDirectMusicPerformance8_InitAudio(idmusicperformance ,NULL,
|
||||
&pDirectSound, NULL, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL);
|
||||
return hr;
|
||||
}
|
||||
|
||||
static void test_PChannelInfo(void)
|
||||
{
|
||||
IDirectMusicPort *pDirectMusicPort;
|
||||
HRESULT hr;
|
||||
|
||||
pDirectMusicPort = NULL;
|
||||
hr = IDirectMusicPerformance8_PChannelInfo(idmusicperformance, 0, &pDirectMusicPort, NULL, NULL);
|
||||
ok(hr == S_OK, "Failed to call PChannelInfo (%x)\n", hr);
|
||||
todo_wine ok(pDirectMusicPort != NULL, "IDirectMusicPort not set\n");
|
||||
if (hr == S_OK && pDirectMusicPort != NULL)
|
||||
IDirectMusicPort_Release(pDirectMusicPort);
|
||||
}
|
||||
|
||||
static void test_GetDefaultAudioPath(void)
|
||||
{
|
||||
IDirectMusicAudioPath *pDirectMusicAudioPath;
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectMusicPerformance8_GetDefaultAudioPath(idmusicperformance, &pDirectMusicAudioPath);
|
||||
ok(hr == S_OK, "Failed to call GetDefaultAudioPath (%x)\n", hr);
|
||||
if (hr == S_OK)
|
||||
IDirectMusicAudioPath_Release(pDirectMusicAudioPath);
|
||||
}
|
||||
|
||||
static void test_CloseDown(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectMusicPerformance8_CloseDown(idmusicperformance);
|
||||
ok(hr == S_OK, "Failed to call CloseDown (%x)\n", hr);
|
||||
}
|
||||
|
||||
START_TEST( performance )
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoInitialize(NULL);
|
||||
if (FAILED(hr)) {
|
||||
skip("Cannot initialize COM (%x)\n", hr);
|
||||
return;
|
||||
}
|
||||
|
||||
hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL,
|
||||
CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8, (LPVOID *)&idmusicperformance);
|
||||
if (hr != S_OK) {
|
||||
skip("Cannot create DirectMusicPerformance object (%x)\n", hr);
|
||||
CoUninitialize();
|
||||
return;
|
||||
}
|
||||
|
||||
hr = test_InitAudio();
|
||||
if (hr != S_OK) {
|
||||
skip("InitAudio failed (%x)\n", hr);
|
||||
return;
|
||||
}
|
||||
|
||||
test_GetDefaultAudioPath();
|
||||
test_PChannelInfo();
|
||||
test_CloseDown();
|
||||
|
||||
IDirectMusicPerformance8_Release(idmusicperformance);
|
||||
CoUninitialize();
|
||||
}
|
Loading…
Reference in New Issue