From d95c70aa684befb78650bad7f18169f71e9c22d6 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Tue, 23 Feb 2021 01:42:34 +0100 Subject: [PATCH] Add a test for the midistate last velocity --- tests/MidiStateT.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/MidiStateT.cpp b/tests/MidiStateT.cpp index 9e25f162..5bec78ee 100644 --- a/tests/MidiStateT.cpp +++ b/tests/MidiStateT.cpp @@ -82,3 +82,11 @@ TEST_CASE("[MidiState] Extended CCs") sfz::MidiState state; state.ccEvent(0, 142, 64_norm); // should not trap } + +TEST_CASE("[MidiState] Last note velocity") +{ + sfz::MidiState state; + state.noteOnEvent(0, 62, 64_norm); + state.noteOnEvent(0, 60, 10_norm); + REQUIRE(state.getLastVelocity() == 10_norm); +}