diff options
author | Damiano Galassi <[email protected]> | 2015-10-28 08:14:08 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-28 08:14:08 +0100 |
commit | 5adcef6070a6b8f91a92d2c22e5449dab3b15a34 (patch) | |
tree | bd53553287de79de7062000eb987df205f397304 | |
parent | 445938b7d30f2c7c695e8250c1e44d765c63531c (diff) |
MacGui: add some subtitles tracks to the fake title used in tests.
-rw-r--r-- | macosx/HandBrake Tests/HBJobTests.m | 2 | ||||
-rw-r--r-- | macosx/HandBrake Tests/HBMockTitle.h | 12 | ||||
-rw-r--r-- | macosx/HandBrake Tests/HBMockTitle.m | 62 |
3 files changed, 30 insertions, 46 deletions
diff --git a/macosx/HandBrake Tests/HBJobTests.m b/macosx/HandBrake Tests/HBJobTests.m index c5044b7a6..ddcb28a86 100644 --- a/macosx/HandBrake Tests/HBJobTests.m +++ b/macosx/HandBrake Tests/HBJobTests.m @@ -66,7 +66,7 @@ - (void)testAudio { - XCTAssertEqual(self.job.audio.tracks.count, 2); + XCTAssertGreaterThan(self.job.audio.tracks.count, 1); } - (void)testPictureSize diff --git a/macosx/HandBrake Tests/HBMockTitle.h b/macosx/HandBrake Tests/HBMockTitle.h index ee1f87a62..e83a13ad2 100644 --- a/macosx/HandBrake Tests/HBMockTitle.h +++ b/macosx/HandBrake Tests/HBMockTitle.h @@ -1,10 +1,8 @@ -// -// HBMockTitle.h -// HandBrake -// -// Created by Damiano Galassi on 30/05/15. -// -// +/* HBMockTitle + + This file is part of the HandBrake source code. + Homepage: <http://handbrake.fr/>. + It may be used under the terms of the GNU General Public License. */ #import <Foundation/Foundation.h> #import "HBTitle.h" diff --git a/macosx/HandBrake Tests/HBMockTitle.m b/macosx/HandBrake Tests/HBMockTitle.m index 9cfd374a3..217f56bfc 100644 --- a/macosx/HandBrake Tests/HBMockTitle.m +++ b/macosx/HandBrake Tests/HBMockTitle.m @@ -1,10 +1,8 @@ -// -// HBMockTitle.m -// HandBrake -// -// Created by Damiano Galassi on 30/05/15. -// -// +/* HBMockTitle + + This file is part of the HandBrake source code. + Homepage: <http://handbrake.fr/>. + It may be used under the terms of the GNU General Public License. */ #import "HBMockTitle.h" #import "HBChapter.h" @@ -119,48 +117,36 @@ extern NSString *keySubTrackType; { NSMutableArray *tracks = [NSMutableArray array]; [tracks addObject: @{keyAudioTrackIndex: @1, - keyAudioTrackName: [NSString stringWithFormat: @"%d: %s", 1, "English"], + keyAudioTrackName: [NSString stringWithFormat: @"%d: %s", 0, "English"], keyAudioInputBitrate: @104, keyAudioInputSampleRate: @48000, keyAudioInputCodec: @65536, keyAudioInputCodecParam: @86018, keyAudioInputChannelLayout: @3, keyAudioTrackLanguageIsoCode: @"eng"}]; + + [tracks addObject: @{keyAudioTrackIndex: @2, + keyAudioTrackName: [NSString stringWithFormat: @"%d: %s", 1, "Italian"], + keyAudioInputBitrate: @104, + keyAudioInputSampleRate: @48000, + keyAudioInputCodec: @65536, + keyAudioInputCodecParam: @86018, + keyAudioInputChannelLayout: @3, + keyAudioTrackLanguageIsoCode: @"ita"}]; return [tracks copy]; } - (NSArray *)subtitlesTracks { - /*if (!_subtitlesTracks) - { - NSMutableArray *tracks = [NSMutableArray array]; - hb_subtitle_t *subtitle; - hb_list_t *list = self.hb_title->list_subtitle; - int count = hb_list_count(list); - - for (int i = 0; i < count; i++) - { - subtitle = (hb_subtitle_t *) hb_list_item(self.hb_title->list_subtitle, i); - - // Human-readable representation of subtitle->source - NSString *bitmapOrText = subtitle->format == PICTURESUB ? @"Bitmap" : @"Text"; - NSString *subSourceName = @(hb_subsource_name(subtitle->source)); - - // Use the native language name if available - iso639_lang_t *language = lang_for_code2(subtitle->iso639_2); - NSString *nativeLanguage = strlen(language->native_name) ? @(language->native_name) : @(language->eng_name); - - // create a dictionary of source subtitle information to store in our array - [tracks addObject:@{keySubTrackName: [NSString stringWithFormat:@"%d: %@ (%@) (%@)", i, nativeLanguage, bitmapOrText, subSourceName], - keySubTrackType: @(subtitle->source), - keySubTrackLanguage: nativeLanguage, - keySubTrackLanguageIsoCode: @(subtitle->iso639_2)}]; - } - - _subtitlesTracks = [tracks copy]; - }*/ - - return nil; + NSMutableArray *tracks = [NSMutableArray array]; + NSString *nativeLanguage = @"English"; + + // create a dictionary of source subtitle information to store in our array + [tracks addObject:@{keySubTrackName: [NSString stringWithFormat:@"%d: %@ (%@) (%@)", 0, nativeLanguage, @"Bitmap", @"VobSub"], + keySubTrackType: @0, + keySubTrackLanguageIsoCode: @"eng"}]; + + return [tracks copy]; } - (NSArray<HBChapter *> *)chapters |