-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #68: Added regression test for -[MIKMIDISequencer builtinSynthe…
…sizerForTrack:] returning nil when it shouldn't.
- Loading branch information
Andrew Madsen
committed
Mar 13, 2015
1 parent
a70a1f0
commit b34e1e6
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// MIKMIDISequencerTests.m | ||
// MIKMIDI | ||
// | ||
// Created by Andrew Madsen on 3/13/15. | ||
// Copyright (c) 2015 Mixed In Key. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import <XCTest/XCTest.h> | ||
#import <MIKMIDI/MIKMIDI.h> | ||
|
||
@interface MIKMIDISequencerTests : XCTestCase | ||
|
||
@property (nonatomic, strong) MIKMIDISequencer *sequencer; | ||
|
||
@end | ||
|
||
@implementation MIKMIDISequencerTests | ||
|
||
- (void)setUp | ||
{ | ||
[super setUp]; | ||
|
||
self.sequencer = [MIKMIDISequencer sequencer]; | ||
} | ||
|
||
- (void)tearDown | ||
{ | ||
[super tearDown]; | ||
} | ||
|
||
- (void)testBuiltinSynthesizers | ||
{ | ||
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; | ||
NSURL *testMIDIFileURL = [bundle URLForResource:@"bach" withExtension:@"mid"]; | ||
NSError *error = nil; | ||
MIKMIDISequence *sequence = [MIKMIDISequence sequenceWithFileAtURL:testMIDIFileURL convertMIDIChannelsToTracks:NO error:&error]; | ||
XCTAssertNotNil(sequence); | ||
|
||
self.sequencer.sequence = sequence; | ||
for (MIKMIDITrack *track in sequence.tracks) { | ||
MIKMIDISynthesizer *synth = [self.sequencer builtinSynthesizerForTrack:track]; | ||
XCTAssertNotNil(synth, @"-builtinSynthesizerForTrack: test failed, because it returned nil."); | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters