diff --git a/core/libs/prx/libSceAudioOut/tests/HostVolume.cpp b/core/libs/prx/libSceAudioOut/tests/HostVolume.cpp index a709527c01..a5d0c91454 100644 --- a/core/libs/prx/libSceAudioOut/tests/HostVolume.cpp +++ b/core/libs/prx/libSceAudioOut/tests/HostVolume.cpp @@ -13,6 +13,7 @@ void require(bool condition, const char* message) { void defaultState() { HostVolume state; require(state.Volume() == 100, "the volume starts at 100"); + require(!state.Muted(), "the host volume starts unmuted"); } void stepsDown() { @@ -46,6 +47,29 @@ void stepsStopAtMaximum() { require(state.Volume() == 100, "the volume never goes above 100"); } +void muteKeepsVolume() { + HostVolume state; + state.VolumeDown(); + state.VolumeDown(); + require(state.Volume() == 90, "two steps down give 90"); + require(state.ToggleMute(), "muting changes the state"); + require(state.Muted() && state.Volume() == 90, "muting leaves the volume alone"); + require(state.ToggleMute(), "unmuting changes the state"); + require(!state.Muted() && state.Volume() == 90, "unmuting restores the volume that was set"); +} + +void muteAtZeroAndMaximum() { + HostVolume state; + state.ToggleMute(); + require(state.Volume() == 100, "muting at 100 keeps 100"); + state.ToggleMute(); + for (int step = 0; step < 20; ++step) state.VolumeDown(); + state.ToggleMute(); + require(state.Muted() && state.Volume() == 0, "muting at 0 keeps 0"); + state.ToggleMute(); + require(!state.Muted() && state.Volume() == 0, "unmuting at 0 leaves 0"); +} + } int main() try { @@ -54,6 +78,8 @@ int main() try { stepsStopAtZero(); stepsUp(); stepsStopAtMaximum(); + muteKeepsVolume(); + muteAtZeroAndMaximum(); std::puts("host volume tests passed"); return 0; } catch (const std::exception& error) {