Module: wine Branch: master Commit: 3400e41d5cca6a2eb869fad7cf2fc68680a1b11a URL: https://gitlab.winehq.org/wine/wine/-/commit/3400e41d5cca6a2eb869fad7cf2fc68...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Sep 28 08:26:45 2023 +0200
dmime/tests: Test performance Init with a created port.
Final Fantasy VIII does this, more or less, and needs Init to succeed.
---
dlls/dmime/tests/dmime.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 12056f15376..f016af2f9e6 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1895,6 +1895,12 @@ static void test_parsedescriptor(void)
static void test_performance_InitAudio(void) { + DMUS_PORTPARAMS params = + { + .dwSize = sizeof(params), + .dwValidParams = DMUS_PORTPARAMS_EFFECTS, + .dwEffectFlags = 1, + }; IDirectMusicPerformance8 *performance; IDirectMusic *dmusic; IDirectSound *dsound; @@ -2036,6 +2042,20 @@ static void test_performance_InitAudio(void) ok(ref == 2, "dmusic ref count got %ld expected 2\n", ref); destroy_performance(performance, dmusic, dsound);
+ /* Provided dmusic and dsound, dmusic initialized with SetDirectSound, port created and activated */ + create_performance(&performance, &dmusic, &dsound, TRUE); + hr = IDirectMusic_SetDirectSound(dmusic, dsound, NULL); + ok(hr == S_OK, "SetDirectSound failed: %#lx\n", hr); + hr = IDirectMusic_CreatePort(dmusic, &CLSID_DirectMusicSynth, ¶ms, &port, NULL); + ok(hr == S_OK, "CreatePort failed: %#lx\n", hr); + hr = IDirectMusicPort_Activate(port, TRUE); + ok(hr == S_OK, "Activate failed: %#lx\n", hr); + hr = IDirectMusicPort_SetNumChannelGroups(port, 1); + ok(hr == S_OK, "SetNumChannelGroups failed: %#lx\n", hr); + hr = IDirectMusicPerformance8_Init(performance, &dmusic, dsound, 0); + todo_wine ok(hr == S_OK, "Init failed: %#lx\n", hr); + destroy_performance(performance, dmusic, dsound); + /* InitAudio with perf channel count not a multiple of 16 rounds up */ create_performance(&performance, NULL, NULL, TRUE); hr = IDirectMusicPerformance8_InitAudio(performance, NULL, NULL, NULL,