From 2f65caaa949543241d563409107f3ca324821150 Mon Sep 17 00:00:00 2001 From: Reid Main Date: Thu, 20 Jun 2019 14:05:20 -0700 Subject: [PATCH 1/2] Fixed FBSnapshotTestCaseDefaultSuffixes to return the correct suffixes based on the architecture. --- FBSnapshotTestCase/FBSnapshotTestCasePlatform.m | 10 ++++------ .../FBSnapshotTestCaseDemoTests.m | 7 ------- ...napshotRecordedOnlyFor64BitArchitecture@2x.png | Bin 423 -> 0 bytes ...napshotRecordedOnlyFor64BitArchitecture@3x.png | Bin 594 -> 0 bytes build.sh | 2 ++ 5 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotRecordedOnlyFor64BitArchitecture@2x.png delete mode 100644 FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotRecordedOnlyFor64BitArchitecture@3x.png diff --git a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m index e7ee8e8..9d28bb8 100644 --- a/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m +++ b/FBSnapshotTestCase/FBSnapshotTestCasePlatform.m @@ -21,13 +21,11 @@ BOOL FBSnapshotTestCaseIs64Bit(void) NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void) { - NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init]; - [suffixesSet addObject:@"_32"]; - [suffixesSet addObject:@"_64"]; if (FBSnapshotTestCaseIs64Bit()) { - return [suffixesSet reversedOrderedSet]; + return [NSOrderedSet orderedSetWithObject:@"_64"]; + } else { + return [NSOrderedSet orderedSetWithObject:@"_32"]; } - return [suffixesSet copy]; } NSString *FBFileNameIncludeNormalizedFileNameFromOption(NSString *fileName, FBSnapshotTestCaseFileNameIncludeOption option) @@ -54,7 +52,7 @@ BOOL FBSnapshotTestCaseIs64Bit(void) [invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]]; NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters]; fileName = [validComponents componentsJoinedByString:@"_"]; - + if ((option & FBSnapshotTestCaseFileNameIncludeOptionScreenScale) == FBSnapshotTestCaseFileNameIncludeOptionScreenScale) { CGFloat screenScale = [[UIScreen mainScreen] scale]; fileName = [fileName stringByAppendingFormat:@"@%.fx", screenScale]; diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m index e37338c..508be31 100644 --- a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m +++ b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/FBSnapshotTestCaseDemoTests.m @@ -92,11 +92,4 @@ - (void)testViewSnapshotWithDifferentBackgroundColorPerArchitecture FBSnapshotVerifyView(view, nil); } -- (void)testViewSnapshotRecordedOnlyFor64BitArchitecture -{ - UIView *greenView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; - greenView.backgroundColor = [UIColor greenColor]; - FBSnapshotVerifyView(greenView, nil); -} - @end diff --git a/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotRecordedOnlyFor64BitArchitecture@2x.png b/FBSnapshotTestCaseDemo/FBSnapshotTestCaseDemoTests/ReferenceImages_64/FBSnapshotTestCaseDemoTests/testViewSnapshotRecordedOnlyFor64BitArchitecture@2x.png deleted file mode 100644 index 9d8159bda328299bbc6e846773afc0f9e857ca6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)jKx9jP7LeL$-D$|I14-?iy0Wi zR6&^0Gf3qFP*5h*#Xkf{GXXIOXrSSP*IjEgfnvR$E{-7;jBhS&j Date: Thu, 20 Jun 2019 17:43:49 -0700 Subject: [PATCH 2/2] Removed iPhone from build script --- build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.sh b/build.sh index fba56e1..25bd7ef 100755 --- a/build.sh +++ b/build.sh @@ -46,9 +46,7 @@ function ci_carthage_demo() { popd } -ci_lib "iPhone 5" && ci_demo "iPhone 5" ci_lib "iPhone 7" && ci_demo "iPhone 7" ci_lib "iPhone X" && ci_demo "iPhone X" -ci_lib "iPhone 5" && ci_carthage_demo "iPhone 5" ci_lib "iPhone 7" && ci_carthage_demo "iPhone 7" ci_lib "iPhone X" && ci_carthage_demo "iPhone X"