diff --git a/SpriteBuilder/SpriteBuilder Tests/CCBPublisherController_Tests.m b/SpriteBuilder/SpriteBuilder Tests/CCBPublisherController_Tests.m index 454343af0..6ea2743c5 100644 --- a/SpriteBuilder/SpriteBuilder Tests/CCBPublisherController_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/CCBPublisherController_Tests.m @@ -35,7 +35,6 @@ - (void)setUp self.projectSettings = [[ProjectSettings alloc] init]; _projectSettings.projectPath = [self fullPathForFile:@"baa.spritebuilder/publishtest.ccbproj"]; _projectSettings.publishDirectory = @"../Published-iOS"; - _projectSettings.publishDirectoryAndroid = @"../Published-Android"; self.publisherController = [[CCBPublisherController alloc] init]; _publisherController.projectSettings = _projectSettings; @@ -67,10 +66,6 @@ - (void)configureSinglePackagePublishSettingCase iosSettings.resolution_tablethd = YES; iosSettings.resolution_phone = YES; - PublishOSSettings *androidSettings = [_packageSettings settingsForOsType:kCCBPublisherOSTypeAndroid]; - androidSettings.resolution_tablet = YES; - androidSettings.resolution_phonehd = YES; - [self createFolders:@[@"baa.spritebuilder/Packages/foo.sbpack"]]; _publisherController.packageSettings = @[_packageSettings]; @@ -86,14 +81,10 @@ - (void)testPackageExportToDefaultDirectory [self assertFileDoesNotExist:@"Published-Packages/foo-iOS-tablethd"]; [self assertFileDoesNotExist:@"Published-Packages/foo-iOS-phone"]; - [self assertFileDoesNotExist:@"Published-Packages/foo-Android-tablet"]; - [self assertFileDoesNotExist:@"Published-Packages/foo-Android-phonehd"]; [self assertFilesExistRelativeToDirectory:[@"baa.spritebuilder" stringByAppendingPathComponent:DEFAULT_OUTPUTDIR_PUBLISHED_PACKAGES] filesPaths:@[ @"foo-iOS-tablethd.zip", - @"foo-iOS-phone.zip", - @"foo-Android-tablet.zip", - @"foo-Android-phonehd.zip" + @"foo-iOS-phone.zip" ]]; } @@ -102,7 +93,6 @@ - (void)testMainProjectPublishWithOldResourcePath [self configureSinglePackagePublishSettingCase]; _projectSettings.publishEnabledIOS = NO; - _projectSettings.publishEnabledAndroid = YES; _packageSettings.publishToZip = NO; _packageSettings.publishToMainProject = YES; @@ -118,17 +108,6 @@ - (void)testMainProjectPublishWithOldResourcePath [_publisherController startAsync:NO]; - - [self assertFilesExistRelativeToDirectory:@"Published-Android" filesPaths:@[ - @"resources-phone/sun.png", - @"resources-phonehd/sun.png", - @"resources-tablet/sun.png", - @"resources-tablethd/sun.png", - @"resources-phone/plane.png", - @"resources-phonehd/plane.png", - @"resources-tablet/plane.png", - @"resources-tablethd/plane.png" - ]]; } - (void)testPackageExportToCustomDirectory @@ -143,15 +122,12 @@ - (void)testPackageExportToCustomDirectory PublishOSSettings *iosSettings = [_packageSettings settingsForOsType:kCCBPublisherOSTypeIOS]; iosSettings.resolutions = @[]; - PublishOSSettings *androidSettings = [_packageSettings settingsForOsType:kCCBPublisherOSTypeAndroid]; - androidSettings.resolutions = @[]; - androidSettings.resolution_phone = YES; - [_publisherController startAsync:NO]; - + /* [self assertFilesExistRelativeToDirectory:@"custom" filesPaths:@[ @"foo-Android-phone.zip" ]]; + */ } - (void)testPublishMainProjectWithSomePackagesNotIncluded @@ -164,7 +140,6 @@ - (void)testPublishMainProjectWithSomePackagesNotIncluded [_projectSettings addResourcePath:[self fullPathForFile:@"baa.spritebuilder/Packages/Characters.sbpack"] error:nil]; [_projectSettings addResourcePath:[self fullPathForFile:@"baa.spritebuilder/Packages/Backgrounds.sbpack"] error:nil]; _projectSettings.publishEnabledIOS = YES; - _projectSettings.publishEnabledAndroid = YES; SBPackageSettings *packageSettingsMenus = [self createSettingsWithPath:@"baa.spritebuilder/Packages/Menus.sbpack"]; packageSettingsMenus.publishToMainProject = NO; @@ -183,7 +158,7 @@ - (void)testPublishMainProjectWithSomePackagesNotIncluded [_publisherController startAsync:NO]; NSArray *resolutions = @[RESOLUTION_TABLET, RESOLUTION_TABLET_HD, RESOLUTION_PHONE, RESOLUTION_PHONE_HD]; - NSArray *osSuffixes = @[@"iOS", @"Android"]; + NSArray *osSuffixes = @[@"iOS"]; for (NSString *osSuffix in osSuffixes) { @@ -229,7 +204,6 @@ - (void)testNothingToPublish [_publisherController startAsync:NO]; [self assertFileDoesNotExist:@"Published-iOS"]; - [self assertFileDoesNotExist:@"Published-Android"]; [self assertFileDoesNotExist:DEFAULT_OUTPUTDIR_PUBLISHED_PACKAGES]; } diff --git a/SpriteBuilder/SpriteBuilder Tests/CCBPublisher_Tests.m b/SpriteBuilder/SpriteBuilder Tests/CCBPublisher_Tests.m index d234281f6..aa7949374 100644 --- a/SpriteBuilder/SpriteBuilder Tests/CCBPublisher_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/CCBPublisher_Tests.m @@ -30,7 +30,6 @@ @interface CCBPublisher_Tests : FileSystemTestCase @property (nonatomic, strong) CCBWarnings *warnings; @property (nonatomic, strong) CCBPublisher *publisher; @property (nonatomic, strong) CCBPublishingTarget *targetIOS; -@property (nonatomic, strong) CCBPublishingTarget *targetAndroid; @end @@ -44,7 +43,6 @@ - (void)setUp self.projectSettings = [[ProjectSettings alloc] init]; _projectSettings.projectPath = [self fullPathForFile:@"baa.spritebuilder/publishtest.ccbproj"]; _projectSettings.publishEnabledIOS = YES; - _projectSettings.publishEnabledAndroid = NO; RMPackage *package = [[RMPackage alloc] init]; package.dirPath = [self fullPathForFile:@"baa.spritebuilder/Packages/foo.sbpack"]; @@ -64,13 +62,7 @@ - (void)setUp _targetIOS.outputDirectory = [self fullPathForFile:@"Published-iOS"]; _targetIOS.resolutions = [_projectSettings publishingResolutionsForOSType:kCCBPublisherOSTypeIOS]; - self.targetAndroid = [[CCBPublishingTarget alloc] init]; - _targetAndroid.osType = kCCBPublisherOSTypeAndroid; - _targetAndroid.inputDirectories = @[[self fullPathForFile:@"baa.spritebuilder/Packages/foo.sbpack"]]; - _targetAndroid.outputDirectory = [self fullPathForFile:@"Published-Android"]; - _targetAndroid.resolutions = [_projectSettings publishingResolutionsForOSType:kCCBPublisherOSTypeAndroid]; - - [self createFolders:@[@"Published-iOS", @"Published-Android", @"baa.spritebuilder/Packages/foo.sbpack"]]; + [self createFolders:@[@"Published-iOS", @"baa.spritebuilder/Packages/foo.sbpack"]]; } - (void)testPublishingProject @@ -148,27 +140,14 @@ - (void)testPublishingOfResolutions _projectSettings.publishResolution_ios_phone = NO; _projectSettings.publishResolution_ios_phonehd = YES; - _projectSettings.publishEnabledAndroid = YES; - _projectSettings.publishResolution_android_tablet = NO; - _projectSettings.publishResolution_android_tablethd = YES; - _projectSettings.publishResolution_android_phone = YES; - _projectSettings.publishResolution_android_phonehd = NO; - _targetIOS.resolutions = [_projectSettings publishingResolutionsForOSType:kCCBPublisherOSTypeIOS]; [_publisher addPublishingTarget:_targetIOS]; - _targetAndroid.resolutions = [_projectSettings publishingResolutionsForOSType:kCCBPublisherOSTypeAndroid]; - [_publisher addPublishingTarget:_targetAndroid]; [_publisher start]; [self assertFileExists:@"Published-iOS/resources-phonehd/picture.png"]; [self assertFileExists:@"Published-iOS/resources-tablet/picture.png"]; [self assertFileDoesNotExist:@"Published-iOS/resources-phone/picture.png"]; [self assertFileDoesNotExist:@"Published-iOS/resources-tablethd/picture.png"]; - - [self assertFileExists:@"Published-Android/resources-phone/picture.png"]; - [self assertFileExists:@"Published-Android/resources-tablethd/picture.png"]; - [self assertFileDoesNotExist:@"Published-Android/resources-phonehd/picture.png"]; - [self assertFileDoesNotExist:@"Published-Android/resources-tablet/picture.png"]; } - (void)testPublishBMFont @@ -241,49 +220,34 @@ - (void)testCustomScalingFactorsForImages [self assertPNGAtPath:@"Published-iOS/resources-phonehd/rocket.png" hasWidth:8 hasHeight:40]; } -- (void)testDifferentOutputFormatsForIOSAndAndroid +- (void)testDifferentOutputFormatsForIOS { [self createPNGAtPath:@"baa.spritebuilder/Packages/foo.sbpack/resources-auto/rocket.png" width:4 height:20]; [self copyTestingResource:@"blank.wav" toFolder:@"baa.spritebuilder/Packages/foo.sbpack"]; - _projectSettings.publishEnabledAndroid = YES; _projectSettings.resourceAutoScaleFactor = 4; [_projectSettings setProperty:@(kFCImageFormatJPG_High) forRelPath:@"rocket.png" andKey:RESOURCE_PROPERTY_IOS_IMAGE_FORMAT]; - [_projectSettings setProperty:@(kFCImageFormatJPG_High) forRelPath:@"rocket.png" andKey:RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT]; [_projectSettings setProperty:@(kFCSoundFormatMP4) forRelPath:@"blank.wav" andKey:RESOURCE_PROPERTY_IOS_SOUND]; [_publisher addPublishingTarget:_targetIOS]; - [_publisher addPublishingTarget:_targetAndroid]; [_publisher start]; [self assertRenamingRuleInfFileLookup:@"Published-iOS/fileLookup.plist" originalName:@"rocket.png" renamedName:@"rocket.jpg"]; [self assertRenamingRuleInfFileLookup:@"Published-iOS/fileLookup.plist" originalName:@"blank.wav" renamedName:@"blank.m4a"]; - [self assertRenamingRuleInfFileLookup:@"Published-Android/fileLookup.plist" originalName:@"rocket.png" renamedName:@"rocket.jpg"]; - [self assertRenamingRuleInfFileLookup:@"Published-Android/fileLookup.plist" originalName:@"blank.wav" renamedName:@"blank.ogg"]; - [self assertJPGAtPath:@"Published-iOS/resources-tablet/rocket.jpg" hasWidth:2 hasHeight:10]; [self assertJPGAtPath:@"Published-iOS/resources-tablethd/rocket.jpg" hasWidth:4 hasHeight:20]; [self assertJPGAtPath:@"Published-iOS/resources-phone/rocket.jpg" hasWidth:1 hasHeight:5]; [self assertJPGAtPath:@"Published-iOS/resources-phonehd/rocket.jpg" hasWidth:2 hasHeight:10]; - [self assertJPGAtPath:@"Published-Android/resources-tablet/rocket.jpg" hasWidth:2 hasHeight:10]; - [self assertJPGAtPath:@"Published-Android/resources-tablethd/rocket.jpg" hasWidth:4 hasHeight:20]; - [self assertJPGAtPath:@"Published-Android/resources-phone/rocket.jpg" hasWidth:1 hasHeight:5]; - [self assertJPGAtPath:@"Published-Android/resources-phonehd/rocket.jpg" hasWidth:2 hasHeight:10]; - [self assertFileExists:@"Published-iOS/blank.m4a"]; - [self assertFileExists:@"Published-Android/blank.ogg"]; NSData *wavData = [[NSFileManager defaultManager] contentsAtPath:[self fullPathForFile:@"baa.spritebuilder/Packages/foo.sbpack/blank.wav"]]; NSData *m4aData = [[NSFileManager defaultManager] contentsAtPath:[self fullPathForFile:@"Published-iOS/blank.m4a"]]; - NSData *oggData = [[NSFileManager defaultManager] contentsAtPath:[self fullPathForFile:@"Published-Android/blank.ogg"]]; XCTAssertNotNil(wavData, @"wav data must not be nil"); XCTAssertNotNil(m4aData, @"m4a data must not be nil"); - XCTAssertNotNil(oggData, @"ogg data must not be nil"); XCTAssertTrue(![m4aData isEqualToData:wavData], @"m4a data must be different than wav data"); - XCTAssertTrue(![oggData isEqualToData:wavData], @"ogg data must be different than wav data"); } - (void)testSpriteSheets @@ -439,15 +403,12 @@ - (void)testEnums { XCTAssertEqual(kCCBPublisherOSTypeHTML5, 0, @"Enum value kCCBPublisherOSTypeHTML5 must not change"); XCTAssertEqual(kCCBPublisherOSTypeIOS, 1, @"Enum value kCCBPublisherOSTypeIOS must not change"); - XCTAssertEqual(kCCBPublisherOSTypeAndroid, 2, @"Enum value kCCBPublisherOSTypeAndroid must not change"); XCTAssertEqual(kCCBPublishEnvironmentDevelop, 0, @"Enum value kCCBPublishEnvironmentDevelop must not change"); XCTAssertEqual(kCCBPublishEnvironmentRelease, 1, @"Enum value kCCBPublishEnvironmentRelease must not change"); XCTAssertEqual(kCCBPublishFormatSound_ios_caf, 0, @"Enum value kCCBPublishFormatSound_ios_caf must not change"); XCTAssertEqual(kCCBPublishFormatSound_ios_mp4, 1, @"Enum value kCCBPublishFormatSound_ios_mp4 must not change"); - - XCTAssertEqual(kCCBPublishFormatSound_android_ogg, 0, @"Enum value kCCBPublishFormatSound_android_ogg must not change"); } #pragma mark - assert helpers diff --git a/SpriteBuilder/SpriteBuilder Tests/ImageFormatAndPropertiesHelper_Tests.m b/SpriteBuilder/SpriteBuilder Tests/ImageFormatAndPropertiesHelper_Tests.m index 3598cdb5c..54c49776e 100644 --- a/SpriteBuilder/SpriteBuilder Tests/ImageFormatAndPropertiesHelper_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/ImageFormatAndPropertiesHelper_Tests.m @@ -38,18 +38,6 @@ - (void)testSupportsCompress XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_High osType:kCCBPublisherOSTypeIOS]); XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_Medium osType:kCCBPublisherOSTypeIOS]); XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_Low osType:kCCBPublisherOSTypeIOS]); - - // Android - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPVR_RGBA8888 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPVR_RGBA4444 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPVR_RGB565 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPVRTC_2BPP osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPVRTC_4BPP osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPNG osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatPNG_8BIT osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_High osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_Medium osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsCompress:kFCImageFormatJPG_Low osType:kCCBPublisherOSTypeAndroid]); } - (void)testSupportsDither @@ -67,20 +55,6 @@ - (void)testSupportsDither XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_High osType:kCCBPublisherOSTypeIOS]); XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_Medium osType:kCCBPublisherOSTypeIOS]); XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_Low osType:kCCBPublisherOSTypeIOS]); - - // Android - XCTAssertTrue([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPNG_8BIT osType:kCCBPublisherOSTypeAndroid]); - XCTAssertTrue([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVR_RGBA4444 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertTrue([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVR_RGB565 osType:kCCBPublisherOSTypeAndroid]); - - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVR_RGBA8888 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVRTC_2BPP osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVRTC_4BPP osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPVR_RGBA8888 osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatPNG osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_High osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_Medium osType:kCCBPublisherOSTypeAndroid]); - XCTAssertFalse([ImageFormatAndPropertiesHelper supportsDither:kFCImageFormatJPG_Low osType:kCCBPublisherOSTypeAndroid]); } @end diff --git a/SpriteBuilder/SpriteBuilder Tests/PreviewView_Tests.m b/SpriteBuilder/SpriteBuilder Tests/PreviewView_Tests.m index 4ef495bed..4d5138a82 100644 --- a/SpriteBuilder/SpriteBuilder Tests/PreviewView_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/PreviewView_Tests.m @@ -76,10 +76,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForImages RESOURCE_PROPERTY_IMAGE_TABLET_SCALE : @(1), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVR_RGBA8888), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(YES), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVR_RGBA8888), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(YES) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(YES) }]; [_previewImageViewController setPreviewedResource:_resource projectSettings:_projectSettings]; @@ -89,10 +86,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForImages RESOURCE_PROPERTY_IMAGE_TABLET_SCALE : @(2), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(NO) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO) }]; } @@ -102,8 +96,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForAudio _resource.type = kCCBResTypeAudio; [self setResourceProperties:@{ RESOURCE_PROPERTY_IOS_SOUND : @(kFCSoundFormatMP4), - RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(1), - RESOURCE_PROPERTY_ANDROID_SOUND : @(2) + RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(1) }]; [_previewAudioViewController setPreviewedResource:_resource @@ -112,8 +105,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForAudio [self setPropertiesIndividuallyAndAssertResourceIsDirtyViewController:_previewAudioViewController properties:@{ RESOURCE_PROPERTY_IOS_SOUND : @(kFCSoundFormatCAF), - RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(4), - RESOURCE_PROPERTY_ANDROID_SOUND : @(5) + RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(4) }]; } @@ -125,10 +117,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForSpriteSheets RESOURCE_PROPERTY_TRIM_SPRITES:@(YES), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVR_RGBA8888), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(YES), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVR_RGBA8888), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(YES) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(YES) }]; [_previewSpriteSheetViewController setPreviewedResource:_resource @@ -139,10 +128,7 @@ - (void)testSettingValueShouldMarkResourceAsDiryForSpriteSheets RESOURCE_PROPERTY_TRIM_SPRITES:@(NO), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(NO) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO) }]; } @@ -153,10 +139,7 @@ - (void)testSettingsValuesForImage RESOURCE_PROPERTY_IMAGE_SCALE_FROM:@(1), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT:@(kFCImageFormatPVR_RGBA8888), RESOURCE_PROPERTY_IOS_IMAGE_DITHER:@(YES), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS:@(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT:@(kFCImageFormatPVR_RGBA8888), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER:@(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS:@(YES) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS:@(YES) }]; [_previewImageViewController setPreviewedResource:_resource projectSettings:_projectSettings]; @@ -167,10 +150,7 @@ - (void)testSettingsValuesForImage RESOURCE_PROPERTY_IMAGE_SCALE_FROM : @(2), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(NO) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO) }]; } @@ -179,10 +159,7 @@ - (void)testSettingsValuesForAudio _resource.type = kCCBResTypeAudio; [self setResourceProperties:@{ RESOURCE_PROPERTY_IOS_SOUND : @(kFCSoundFormatMP4), - RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(1), - // Yes this is illegal app wise but we need a value here that will be different from the set one - RESOURCE_PROPERTY_ANDROID_SOUND : @(kFCSoundFormatCAF), - RESOURCE_PROPERTY_ANDROID_SOUND_QUALITY : @(1) + RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(1) }]; [_previewAudioViewController setPreviewedResource:_resource projectSettings:_projectSettings]; @@ -191,9 +168,7 @@ - (void)testSettingsValuesForAudio isAudio:YES properties:@{ RESOURCE_PROPERTY_IOS_SOUND : @(kFCSoundFormatCAF), - RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(4), - RESOURCE_PROPERTY_ANDROID_SOUND : @(kFCSoundFormatOGG), - RESOURCE_PROPERTY_ANDROID_SOUND_QUALITY : @(6) + RESOURCE_PROPERTY_IOS_SOUND_QUALITY : @(4) }]; } @@ -204,10 +179,7 @@ - (void)testSettingsValuesForSpriteSheet RESOURCE_PROPERTY_TRIM_SPRITES : @(NO), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT:@(kFCImageFormatPVR_RGBA8888), RESOURCE_PROPERTY_IOS_IMAGE_DITHER:@(YES), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS:@(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT:@(kFCImageFormatPVR_RGBA8888), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER:@(YES), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS:@(YES) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS:@(YES) }]; [_previewSpriteSheetViewController setPreviewedResource:_resource projectSettings:_projectSettings]; @@ -218,10 +190,7 @@ - (void)testSettingsValuesForSpriteSheet RESOURCE_PROPERTY_TRIM_SPRITES : @(YES), RESOURCE_PROPERTY_IOS_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), RESOURCE_PROPERTY_IOS_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_FORMAT : @(kFCImageFormatPVRTC_4BPP), - RESOURCE_PROPERTY_ANDROID_IMAGE_DITHER : @(NO), - RESOURCE_PROPERTY_ANDROID_IMAGE_COMPRESS : @(NO) + RESOURCE_PROPERTY_IOS_IMAGE_COMPRESS : @(NO) }]; } diff --git a/SpriteBuilder/SpriteBuilder Tests/ProjectSettings_Tests.m b/SpriteBuilder/SpriteBuilder Tests/ProjectSettings_Tests.m index b9e6e10cb..0ba871195 100644 --- a/SpriteBuilder/SpriteBuilder Tests/ProjectSettings_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/ProjectSettings_Tests.m @@ -212,22 +212,16 @@ - (void)testInitWithDictionary RESOURCE_PROPERTY_IMAGE_SCALE_FROM:@(1) } }, - @"publishDirectoryAndroid":@"Source/Resources/Published-Android", @"defaultOrientation":@(0), - @"publishResolution_android_tablet":@(YES), - @"publishEnabledAndroid":@(YES), @"publishResolution_ios_phonehd":@(YES), @"publishResolution_ios_tablet":@(YES), - @"publishResolution_android_phone":@(YES), @"fileType":@"CocosBuilderProject", @"resourcePaths":@[ @{ @"path":@"packages/SpriteBuilder Resources.sbpack" } ], - @"publishAudioQuality_android":@(4), @"deviceOrientationLandscapeLeft":@(YES), - @"publishResolution_android_tablethd":@(YES), @"publishAudioQuality_ios":@(4), @"publishEnvironment":@(0), @"publishEnablediPhone":@(YES), @@ -237,7 +231,6 @@ - (void)testInitWithDictionary @"publishResolution_ios_phone":@(YES), @"publishResolution_ios_tablethd":@(YES), @"deviceOrientationUpsideDown":@(NO), - @"publishResolution_android_phonehd":@(YES), @"deviceOrientationLandscapeRight":@(YES), @"onlyPublishCCBs":@(NO), @"deviceScaling":@(0), @@ -258,15 +251,8 @@ - (void)testInitWithDictionary XCTAssertEqual(project.resourceAutoScaleFactor, 4); SBAssertStringsEqual(project.publishDirectory, @"Source/Resources/Published-iOS"); - SBAssertStringsEqual(project.publishDirectoryAndroid, @"Source/Resources/Published-Android"); XCTAssertEqual(project.defaultOrientation, 0); - XCTAssertTrue(project.publishEnabledAndroid); - XCTAssertTrue(project.publishResolution_android_phone); - XCTAssertTrue(project.publishResolution_android_phonehd); - XCTAssertTrue(project.publishResolution_android_tablet); - XCTAssertTrue(project.publishResolution_android_tablethd); - XCTAssertTrue(project.publishEnabledIOS); XCTAssertTrue(project.publishResolution_ios_phone); XCTAssertTrue(project.publishResolution_ios_phonehd); @@ -275,7 +261,6 @@ - (void)testInitWithDictionary [self assertResourcePaths:@[@"packages/SpriteBuilder Resources.sbpack"] inProject:project]; - XCTAssertEqual(project.publishAudioQuality_android, 4); XCTAssertEqual(project.publishAudioQuality_ios, 4); XCTAssertFalse(project.onlyPublishCCBs); @@ -314,10 +299,8 @@ - (void)testWithSomeMissingKeyAndValues ProjectSettings *project = [[ProjectSettings alloc] initWithSerialization:projectDict]; XCTAssertNotNil(project); - XCTAssertEqual(project.publishAudioQuality_android, DEFAULT_AUDIO_QUALITY); XCTAssertEqual(project.publishAudioQuality_ios, DEFAULT_AUDIO_QUALITY); SBAssertStringsEqual(project.publishDirectory, @""); - SBAssertStringsEqual(project.publishDirectoryAndroid, @""); XCTAssertFalse(project.excludedFromPackageMigration); } @@ -339,7 +322,6 @@ - (void)testStandardInitializerAndPersistency XCTAssertEqual(projectSettings.resourcePaths.count, 0); XCTAssertEqual(projectSettings.engine, CCBTargetEngineCocos2d); SBAssertStringsEqual(projectSettings.publishDirectory, @"Published-iOS"); - SBAssertStringsEqual(projectSettings.publishDirectoryAndroid, @"Published-Android"); XCTAssertFalse(projectSettings.onlyPublishCCBs); XCTAssertFalse(projectSettings.publishToZipFile); @@ -349,21 +331,14 @@ - (void)testStandardInitializerAndPersistency XCTAssertEqual(projectSettings.resourceAutoScaleFactor, 4); XCTAssertTrue(projectSettings.publishEnabledIOS); - XCTAssertTrue(projectSettings.publishEnabledAndroid); XCTAssertTrue(projectSettings.publishResolution_ios_phone); XCTAssertTrue(projectSettings.publishResolution_ios_phonehd); XCTAssertTrue(projectSettings.publishResolution_ios_tablet); XCTAssertTrue(projectSettings.publishResolution_ios_tablethd); - XCTAssertTrue(projectSettings.publishResolution_android_phone); - XCTAssertTrue(projectSettings.publishResolution_android_phonehd); - XCTAssertTrue(projectSettings.publishResolution_android_tablet); - XCTAssertTrue(projectSettings.publishResolution_android_tablethd); - XCTAssertEqual(projectSettings.publishEnvironment, kCCBPublishEnvironmentDevelop); XCTAssertEqual(projectSettings.publishAudioQuality_ios, 4); - XCTAssertEqual(projectSettings.publishAudioQuality_android, 4); XCTAssertEqual(projectSettings.tabletPositionScaleFactor, 2.0f); @@ -442,20 +417,20 @@ - (void)testRelativePathFromAbsolutePath - (void)testConvenienceMethodForAudioQualityOfResources { + /* NSInteger quality = [_projectSettings soundQualityForRelPath:@"foo" osType:kCCBPublisherOSTypeAndroid]; XCTAssertEqual(quality, NSNotFound); - + [_projectSettings setProperty:@(7) forRelPath:@"baa" andKey:RESOURCE_PROPERTY_ANDROID_SOUND_QUALITY]; NSInteger quality2 = [_projectSettings soundQualityForRelPath:@"baa" osType:kCCBPublisherOSTypeAndroid]; XCTAssertEqual(quality2, 7); + */ } - (void)testConvenienceMethodForAudioQuality { - _projectSettings.publishAudioQuality_android = 8; _projectSettings.publishAudioQuality_ios = 6; - XCTAssertEqual([_projectSettings audioQualityForOsType:kCCBPublisherOSTypeAndroid], 8); XCTAssertEqual([_projectSettings audioQualityForOsType:kCCBPublisherOSTypeIOS], 6); } diff --git a/SpriteBuilder/SpriteBuilder Tests/SBPackageSettings_Tests.m b/SpriteBuilder/SpriteBuilder Tests/SBPackageSettings_Tests.m index 5199f545d..d9d028419 100644 --- a/SpriteBuilder/SpriteBuilder Tests/SBPackageSettings_Tests.m +++ b/SpriteBuilder/SpriteBuilder Tests/SBPackageSettings_Tests.m @@ -48,12 +48,6 @@ - (void)testInitialValuesAndKVCPaths PublishOSSettings *osSettingsIOSKVC = [_packagePublishSettings valueForKeyPath:@"osSettings.ios"]; XCTAssertNotNil(osSettingsIOSKVC); - - PublishOSSettings *osSettingsAndroid = [_packagePublishSettings settingsForOsType:kCCBPublisherOSTypeAndroid]; - XCTAssertNotNil(osSettingsAndroid); - - PublishOSSettings *osSettingsAndroidKVC = [_packagePublishSettings valueForKeyPath:@"osSettings.android"]; - XCTAssertNotNil(osSettingsAndroidKVC); } - (void)testPersistency @@ -70,11 +64,6 @@ - (void)testPersistency osSettingsIOS.resolutions = @[@"phone"]; [_packagePublishSettings setOSSettings:osSettingsIOS forOsType:kCCBPublisherOSTypeIOS]; - PublishOSSettings *osSettingsAndroid = [_packagePublishSettings settingsForOsType:kCCBPublisherOSTypeAndroid]; - osSettingsAndroid.audio_quality = 2; - osSettingsAndroid.resolutions = @[@"tablethd"]; - [_packagePublishSettings setOSSettings:osSettingsAndroid forOsType:kCCBPublisherOSTypeAndroid]; - [_packagePublishSettings store]; [self assertFileExists:@"/foo/project.spritebuilder/Packages/mypackage.sbpack/Package.plist"]; @@ -90,11 +79,6 @@ - (void)testPersistency XCTAssertEqual(_packagePublishSettings.publishToCustomOutputDirectory, settingsLoaded.publishToCustomOutputDirectory); XCTAssertEqual(_packagePublishSettings.resourceAutoScaleFactor, settingsLoaded.resourceAutoScaleFactor); - PublishOSSettings *osSettingsAndroidLoaded = [settingsLoaded settingsForOsType:kCCBPublisherOSTypeAndroid]; - XCTAssertEqual(osSettingsAndroidLoaded.audio_quality, osSettingsAndroid.audio_quality); - XCTAssertTrue([osSettingsAndroidLoaded.resolutions containsObject:RESOLUTION_TABLET_HD]); - XCTAssertFalse([osSettingsAndroidLoaded.resolutions containsObject:RESOLUTION_TABLET]); - PublishOSSettings *osSettingsIOSLoaded = [settingsLoaded settingsForOsType:kCCBPublisherOSTypeIOS]; XCTAssertEqual(osSettingsIOSLoaded.audio_quality, osSettingsIOS.audio_quality); XCTAssertTrue([osSettingsIOSLoaded.resolutions containsObject:RESOLUTION_PHONE]);