27248b1ddb
This turned into a rather involved exercise, because the MidiThruConnectionParamsStruct struct had several array fields that needed marshalling to work. The changes include: * Unwrap the array fields with MarshalAs attributes to be individual fields instead. * Write a number of tests to ensure the changes work. * Fix an overflow issue found by the tests for the Controls array if trying to set to an array with more than 65535 elements. * Fix an overflow issue found by the tests for the Maps array if trying to set to an array with more than 65535 elements. * Fix an issue found by the tests where we wouldn't deserialize the Maps array correctly from a byte array / NSData if the Maps array had more than 1 element. * Fix a consistency issue found in the tests where deserializing a serialized structure doesn't yield the same result. * In particular this happens with the ChannelMap property: behavior has changed a little bit where setting the ChannelMap to an array with fewer than 16 elements (including a null array) will not return the same array anymore, but instead an array with 16 elements, where the extra elements are all 0. I've also made the ChannelMap property non-nullable, since the nullability state isn't serializable into the underlying struct. Contributes towards #15684. |
||
---|---|---|
.. | ||
MidiClientTest.cs | ||
MidiEndpointTest.cs | ||
MidiThruConnectionParamsTest.cs | ||
MidiThruConnectionTests.cs |