Add a test for resetAllControllers

This commit is contained in:
Paul Ferrand 2020-03-29 13:20:41 +02:00
parent fc05ca0af0
commit dbe544515f

View file

@ -49,12 +49,25 @@ TEST_CASE("[MidiState] Reset")
state.pitchBendEvent(0, 894);
state.noteOnEvent(0, 64, 24_norm);
state.ccEvent(0, 123, 124_norm);
state.reset(0);
state.reset();
REQUIRE(state.getPitchBend() == 0);
REQUIRE(state.getNoteVelocity(64) == 0_norm);
REQUIRE(state.getCCValue(123) == 0_norm);
}
TEST_CASE("[MidiState] Reset all controllers")
{
sfz::MidiState state;
state.pitchBendEvent(20, 894);
state.ccEvent(10, 122, 124_norm);
REQUIRE(state.getPitchBend() == 894);
REQUIRE(state.getCCValue(122) == 124_norm);
state.resetAllControllers(30);
REQUIRE(state.getPitchBend() == 0);
REQUIRE(state.getCCValue(122) == 0_norm);
REQUIRE(state.getCCValue(4) == 0_norm);
}
TEST_CASE("[MidiState] Set and get note velocities")
{
sfz::MidiState state;