diff --git a/src/tests/audio_core/merryhime_3ds_audio/audio_test_biquad_filter.cpp b/src/tests/audio_core/merryhime_3ds_audio/audio_test_biquad_filter.cpp index 083ad0a5059b..c7dd43e4190e 100644 --- a/src/tests/audio_core/merryhime_3ds_audio/audio_test_biquad_filter.cpp +++ b/src/tests/audio_core/merryhime_3ds_audio/audio_test_biquad_filter.cpp @@ -2,6 +2,7 @@ #include #include "audio_core/hle/shared_memory.h" #include "merry_audio/merry_audio.h" +#include "common/settings.h" TEST_CASE_METHOD(MerryAudio::MerryAudioFixture, "AudioTest-BiquadFilter", "[audio_core][merryhime_3ds_audio]") { @@ -21,13 +22,19 @@ TEST_CASE_METHOD(MerryAudio::MerryAudioFixture, "AudioTest-BiquadFilter", MerryAudio::AudioState state; { - // The test case assumes HLE AudioCore doesn't require a valid firmware - // Uncomment the below line if the test is using LLE audio - // auto dspfirm = loadDspFirmFromFile(); - std::vector dspfirm = {0}; - if (!dspfirm.size()) { - SKIP("Couldn't load firmware\n"); - goto end; + std::vector dspfirm; + SECTION("HLE") { + // The test case assumes HLE AudioCore doesn't require a valid firmware + InitDspCore(Settings::AudioEmulation::HLE); + dspfirm = {}; + } + SECTION("LLE") { + InitDspCore(Settings::AudioEmulation::LLE); + dspfirm = loadDspFirmFromFile(); + if (!dspfirm.size()) { + SKIP("Couldn't load firmware\n"); + goto end; + } } auto ret = audioInit(dspfirm); if (!ret) { diff --git a/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.cpp b/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.cpp index 0d42f02cce1c..922fe9c28936 100644 --- a/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.cpp +++ b/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.cpp @@ -1,5 +1,6 @@ #include "audio_core/hle/hle.h" #include "audio_core/lle/lle.h" +#include "common/settings.h" #include "service_fixture.h" // SVC @@ -108,15 +109,25 @@ void* ServiceFixture::linearAlloc(size_t size) { } Result ServiceFixture::dspInit() { - // dsp = std::make_unique(system, memory, core_timing, false); - dsp = std::make_unique(system, memory, core_timing); - dsp->SetInterruptHandler([this](Service::DSP::InterruptType type, AudioCore::DspPipe pipe) { - interrupts_fired[static_cast(type)][static_cast(pipe)] = 1; - }); + if (!dsp) { + dsp = std::make_unique(system, memory, core_timing); + dsp->SetInterruptHandler([this](Service::DSP::InterruptType type, AudioCore::DspPipe pipe) { + interrupts_fired[static_cast(type)][static_cast(pipe)] = 1; + }); + } + return ResultSuccess; } -Result ServiceFixture::dspExit() { - dsp.reset(); - return ResultSuccess; +// Fixture +void ServiceFixture::InitDspCore(Settings::AudioEmulation dsp_core) { + if (dsp_core == Settings::AudioEmulation::HLE) { + dsp = std::make_unique(system, memory, core_timing); + } else { + dsp = std::make_unique(system, memory, core_timing, + dsp_core == Settings::AudioEmulation::LLEMultithreaded); + } + dsp->SetInterruptHandler([this](Service::DSP::InterruptType type, AudioCore::DspPipe pipe) { + interrupts_fired[static_cast(type)][static_cast(pipe)] = 1; + }); } diff --git a/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.h b/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.h index 8b6587a4ec22..8789f0104fca 100644 --- a/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.h +++ b/src/tests/audio_core/merryhime_3ds_audio/merry_audio/service_fixture.h @@ -4,6 +4,10 @@ #include "core/hle/result.h" #include "core/memory.h" +namespace Settings { +enum class AudioEmulation : u32; +} + class ServiceFixture { public: typedef int Handle; @@ -61,14 +65,18 @@ class ServiceFixture { Result dspInit(); - Result dspExit(); + Result dspExit() { + return ResultSuccess; + } - std::unique_ptr dsp{}; + // Selects the DPS Emulation to use with the fixture + void InitDspCore(Settings::AudioEmulation dsp_core); private: Core::System system{}; Memory::MemorySystem memory{system}; Core::Timing core_timing{1, 100}; + std::unique_ptr dsp{}; std::array, 4> interrupts_fired = {};