Add a test for resetAllControllers
This commit is contained in:
parent
fc05ca0af0
commit
dbe544515f
1 changed files with 14 additions and 1 deletions
|
|
@ -49,12 +49,25 @@ TEST_CASE("[MidiState] Reset")
|
||||||
state.pitchBendEvent(0, 894);
|
state.pitchBendEvent(0, 894);
|
||||||
state.noteOnEvent(0, 64, 24_norm);
|
state.noteOnEvent(0, 64, 24_norm);
|
||||||
state.ccEvent(0, 123, 124_norm);
|
state.ccEvent(0, 123, 124_norm);
|
||||||
state.reset(0);
|
state.reset();
|
||||||
REQUIRE(state.getPitchBend() == 0);
|
REQUIRE(state.getPitchBend() == 0);
|
||||||
REQUIRE(state.getNoteVelocity(64) == 0_norm);
|
REQUIRE(state.getNoteVelocity(64) == 0_norm);
|
||||||
REQUIRE(state.getCCValue(123) == 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")
|
TEST_CASE("[MidiState] Set and get note velocities")
|
||||||
{
|
{
|
||||||
sfz::MidiState state;
|
sfz::MidiState state;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue