Skip to content

Commit

Permalink
Fix comparison in -testMultipleCommandTypesInOnePacket
Browse files Browse the repository at this point in the history
  • Loading branch information
armadsen committed Aug 22, 2017
1 parent 58d4129 commit 717699d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Framework/MIKMIDI Tests/MIKMIDICommandTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ - (void)testManufacturerSpecificSystemExclusiveCommand

- (void)testMultipleCommandTypesInOnePacket
{
NSArray *commands = @[[MIKMIDINoteOnCommand noteOnCommandWithNote:60 velocity:64 channel:0 timestamp:nil],
[MIKMIDIControlChangeCommand controlChangeCommandWithControllerNumber:27 value:63]];
MIDIPacket *packet = MIKMIDIPacketCreateFromCommands(0, commands);
MIKMIDINoteOnCommand *noteOn = [MIKMIDINoteOnCommand noteOnCommandWithNote:60 velocity:64 channel:0 timestamp:nil];
MIKMutableMIDIControlChangeCommand *cc = [MIKMutableMIDIControlChangeCommand controlChangeCommandWithControllerNumber:27 value:63];
cc.midiTimestamp = noteOn.midiTimestamp; // Messages in a MIDIPacket all have the same timestamp.
NSArray *commands = @[noteOn, cc];

MIDIPacket *packet = MIKMIDIPacketCreateFromCommands(cc.midiTimestamp, commands);
NSArray *parsedCommands = [MIKMIDICommand commandsWithMIDIPacket:packet];
XCTAssertEqual(commands, parsedCommands, @"Parsing multiple commands from MIDI packet failed to produce original commands.");
XCTAssertEqualObjects(commands, parsedCommands, @"Parsing multiple commands from MIDI packet failed to produce original commands.");

MIKMIDIPacketFree(packet);
}
Expand Down

0 comments on commit 717699d

Please sign in to comment.