1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MidiMessage: Added VariableLengthValue::isValid() and removed assertion from MidiMessage::readVariableLengthValue()

This commit is contained in:
ed 2021-01-21 10:48:51 +00:00
parent 66311c798f
commit 2fb3637e25
3 changed files with 7 additions and 4 deletions

View file

@ -79,7 +79,6 @@ MidiMessage::VariableLengthValue MidiMessage::readVariableLengthValue (const uin
// bytes of input to construct a full value, or no terminating byte was
// found. This implementation only supports variable-length values of up
// to four bytes.
jassertfalse;
return {};
}
@ -1225,6 +1224,7 @@ struct MidiMessageTest : public UnitTest
const auto result = MidiMessage::readVariableLengthValue (copy.data(),
(int) copy.size());
expect (result.isValid());
expectEquals (result.value, outputs[index]);
expectEquals (result.bytesUsed, (int) inputs[index].size());
@ -1252,6 +1252,7 @@ struct MidiMessageTest : public UnitTest
const auto result = MidiMessage::readVariableLengthValue (input.data(),
(int) input.size());
expect (! result.isValid());
expectEquals (result.value, 0);
expectEquals (result.bytesUsed, 0);
}