Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 27248b1ddb
[CoreMidi] Make P/Invokes have blittable signatures. (#19724)
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.
2024-01-15 17:27:11 +01:00
jamesdlow d9e52067e2
Fix sending MidiPacket when MidiPacket has been created using a pointer (#18981)
Fix sending MidiPacket when MidiPacket has been created using a pointer to a byte[] rather than a byte[] passed as a reference.

MidiPacket.bytes used to be initialized to null, but that changed in a null-refactoring. Unfortunately code that dependend on the initial value being null wasn't updated, so the code regressed. Here we revert the old behavior by making the MidiPacket.bytes field nullable

Also add a test to make sure we don't regress this code again.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-01-02 19:40:32 +01:00
Rolf Bjarne Kvinge 6f45caa84d
[autoformat] Add monotouch-test (#16701) 2022-11-10 17:59:26 +01:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 2b2f1d08dc
[tests] Remove Classic code from all tests. (#8702) 2020-05-28 16:35:09 +02:00
Rolf Bjarne Kvinge ebb66da865
[CoreMidi] Fix creating a native MidiThruConnectionParamsStruct. (#6505)
Make sure to advance the target pointer after writing each map array.
2019-07-07 23:30:37 -07:00
Rolf Bjarne Kvinge ad0d4bad4b
[monotouch-test] Disable the MidiThruConnectionTests tests, they're randomly failing. (#6506)
Ref: https://github.com/xamarin/maccore/issues/1834
2019-07-05 08:12:24 -07:00
Alex Soto fc5f57ed8c
[monotouch-test] Enchance MidiThruConnectionTests.FindTest from #3696 comments (#3700) 2018-03-08 12:51:21 -06:00
Alex Soto 4d51294bdf [monotouch-test] Stop MidiThruConnectionTests.FindTest from randomly failing (#3696)
Fixes xamarin/maccore#658

When a MidiThruConnection is created but for some reason is not disposed
the system keeps it alive even between app/simulator restarts, if you want
to clean the connections you must reset contents and settings from simulator.

In order to avoid this test from failing randomly and since the intent of the
test is to check if `MidiThruConnection.Find` works we change the assert to
`>= 2` since this is at least the number of connections we expect.
2018-03-08 07:33:13 +01:00
Alex Soto 83cfa197a9 [Midi] Fix bug 43582 - MidiEndpoint throws, bad dispose of GCHandle
https://bugzilla.xamarin.com/show_bug.cgi?id=43582

- Thanks to @olegoid for the actual investigation and fix
- Added test that verifies the fix
2016-08-31 01:48:28 -05:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00