Skip to content

Commit 7c53489

Browse files
authored
Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/2018-08-24) (#2222)
* Travis to Xcode 10.1 * Update to clang-format 8 * Update clang-format homebrew link * Work around space in filename style.sh issue
1 parent 074de00 commit 7c53489

File tree

111 files changed

+1070
-1303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1070
-1303
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: osx
2-
osx_image: xcode10
2+
osx_image: xcode10.1
33
language: objective-c
44
cache:
55
- bundler

Example/Core/Tests/FIRAnalyticsConfigurationTest.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,15 @@ - (void)testSettingAnalyticsCollectionEnabled {
9999
[self.observerMock setExpectationOrderMatters:YES];
100100
[[self.observerMock expect] notificationWithName:notificationName
101101
object:config
102-
userInfo:@{
103-
notificationName : @YES
104-
}];
102+
userInfo:@{notificationName : @YES}];
105103

106104
// Test setting to enabled.
107105
[config setAnalyticsCollectionEnabled:YES];
108106

109107
// Expect the second notification.
110108
[[self.observerMock expect] notificationWithName:notificationName
111109
object:config
112-
userInfo:@{
113-
notificationName : @NO
114-
}];
110+
userInfo:@{notificationName : @NO}];
115111

116112
// Test setting to disabled.
117113
[config setAnalyticsCollectionEnabled:NO];

Example/Core/Tests/FIRAppTest.m

Lines changed: 74 additions & 74 deletions
Large diffs are not rendered by default.

Example/Core/Tests/FIROptionsTest.m

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ - (void)testDefaultOptions {
8282
}
8383

8484
- (void)testInitCustomizedOptions {
85-
FIROptions *options =
86-
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
85+
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
86+
GCMSenderID:kGCMSenderID];
8787
options.APIKey = kAPIKey;
8888
options.bundleID = kBundleID;
8989
options.clientID = kClientID;
@@ -98,8 +98,8 @@ - (void)testInitCustomizedOptions {
9898
}
9999

100100
- (void)testInitWithContentsOfFile {
101-
NSString *filePath =
102-
[[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
101+
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info"
102+
ofType:@"plist"];
103103
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
104104
[self assertOptionsMatchDefaults:options andProjectID:YES];
105105
XCTAssertNil(options.deepLinkURLScheme);
@@ -136,8 +136,8 @@ - (void)assertOptionsMatchDefaults:(FIROptions *)options andProjectID:(BOOL)matc
136136

137137
- (void)testCopyingProperties {
138138
NSMutableString *mutableString;
139-
FIROptions *options =
140-
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
139+
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
140+
GCMSenderID:kGCMSenderID];
141141
mutableString = [[NSMutableString alloc] initWithString:@"1"];
142142
options.APIKey = mutableString;
143143
[mutableString appendString:@"2"];
@@ -208,8 +208,8 @@ - (void)testCopyWithZone {
208208
XCTAssertEqualObjects(newOptions.deepLinkURLScheme, kDeepLinkURLScheme);
209209

210210
// customized options
211-
FIROptions *customizedOptions =
212-
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
211+
FIROptions *customizedOptions = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
212+
GCMSenderID:kGCMSenderID];
213213
customizedOptions.deepLinkURLScheme = kDeepLinkURLScheme;
214214
FIROptions *copyCustomizedOptions = [customizedOptions copy];
215215
[copyCustomizedOptions setDeepLinkURLScheme:kNewDeepLinkURLScheme];
@@ -466,20 +466,16 @@ - (void)testAnalyticsCollectionGlobalSwitchOverrideToDisable {
466466
OCMStub([appMock isDataCollectionDefaultEnabled]).andReturn(YES);
467467

468468
// Test the three Analytics flags that override to disable Analytics collection.
469-
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
470-
kFIRIsAnalyticsCollectionEnabled : @NO
471-
}];
469+
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
470+
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @NO}];
472471
XCTAssertFalse(collectionEnabledOptions.isAnalyticsCollectionEnabled);
473472

474-
FIROptions *collectionDeactivatedOptions =
475-
[[FIROptions alloc] initInternalWithOptionsDictionary:@{
476-
kFIRIsAnalyticsCollectionDeactivated : @YES
477-
}];
473+
FIROptions *collectionDeactivatedOptions = [[FIROptions alloc]
474+
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionDeactivated : @YES}];
478475
XCTAssertFalse(collectionDeactivatedOptions.isAnalyticsCollectionEnabled);
479476

480-
FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
481-
kFIRIsMeasurementEnabled : @NO
482-
}];
477+
FIROptions *measurementEnabledOptions =
478+
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @NO}];
483479
XCTAssertFalse(measurementEnabledOptions.isAnalyticsCollectionEnabled);
484480
}
485481

@@ -491,14 +487,12 @@ - (void)testAnalyticsCollectionGlobalSwitchOverrideToEnable {
491487
OCMStub([appMock isDataCollectionDefaultEnabled]).andReturn(NO);
492488

493489
// Test the two Analytics flags that can override and enable collection.
494-
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
495-
kFIRIsAnalyticsCollectionEnabled : @YES
496-
}];
490+
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
491+
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @YES}];
497492
XCTAssertTrue(collectionEnabledOptions.isAnalyticsCollectionEnabled);
498493

499-
FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
500-
kFIRIsMeasurementEnabled : @YES
501-
}];
494+
FIROptions *measurementEnabledOptions =
495+
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @YES}];
502496
XCTAssertTrue(measurementEnabledOptions.isAnalyticsCollectionEnabled);
503497
}
504498

@@ -534,31 +528,27 @@ - (void)testAnalyticsCollectionExplicitlySet {
534528

535529
// Test the old measurement flag.
536530
options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
537-
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
538-
kFIRIsMeasurementEnabled : @YES
539-
}];
531+
analyticsOptions =
532+
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @YES}];
540533
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);
541534

542535
options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
543-
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
544-
kFIRIsMeasurementEnabled : @NO
545-
}];
536+
analyticsOptions =
537+
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
546538
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);
547539

548540
// For good measure, a combination of all 3 (even if they conflict).
549541
optionsDictionary =
550-
@{kFIRIsAnalyticsCollectionDeactivated : @YES,
551-
kFIRIsAnalyticsCollectionEnabled : @YES};
542+
@{kFIRIsAnalyticsCollectionDeactivated : @YES, kFIRIsAnalyticsCollectionEnabled : @YES};
552543
options = [[FIROptions alloc] initInternalWithOptionsDictionary:optionsDictionary];
553-
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
554-
kFIRIsMeasurementEnabled : @NO
555-
}];
544+
analyticsOptions =
545+
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
556546
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);
557547
}
558548

559549
- (void)testModifyingOptionsThrows {
560-
FIROptions *options =
561-
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
550+
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
551+
GCMSenderID:kGCMSenderID];
562552
options.editingLocked = YES;
563553

564554
// Modification to every property should result in an exception.

Example/DynamicLinks/FDLBuilderTestAppObjCTests/FDLBuilderTestAppObjCEarlGreyTests.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ @implementation FDLBuilderTestAppObjCEarlGreyTests
3333
- (void)testOpenFDLFromAppGeneratedLink {
3434
// On first launch, a null FDL Received alert is displayed (by design); in
3535
// this case, we need to dismiss it in order to proceed
36-
BOOL hasFirstInstallAlertDisplayed =
37-
[self confirmPresenceOfFDLAlertWithURL:@"(null)" matchType:@"0" minimumAppVersion:@"(null)"];
36+
BOOL hasFirstInstallAlertDisplayed = [self confirmPresenceOfFDLAlertWithURL:@"(null)"
37+
matchType:@"0"
38+
minimumAppVersion:@"(null)"];
3839
if (hasFirstInstallAlertDisplayed) {
3940
[[EarlGrey selectElementWithMatcher:[GREYMatchers matcherForText:@"Dismiss"]]
4041
performAction:grey_tap()];

Example/DynamicLinks/Tests/FDLURLComponentsTests.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ - (void)testAnalyticsParamsDictionaryRepresentationReturnsCorrectDictionaryEmpty
104104
}
105105

106106
- (void)testAnalyticsParamsFactoryWithParamsReturnsInstanceOfCorrectClass {
107-
id returnValue =
108-
[FIRDynamicLinkGoogleAnalyticsParameters parametersWithSource:@"s" medium:@"m" campaign:@"c"];
107+
id returnValue = [FIRDynamicLinkGoogleAnalyticsParameters parametersWithSource:@"s"
108+
medium:@"m"
109+
campaign:@"c"];
109110
XCTAssertTrue([returnValue isKindOfClass:[FIRDynamicLinkGoogleAnalyticsParameters class]]);
110111
}
111112

Example/DynamicLinks/Tests/UtilitiesTests.m

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ - (void)testFDLCookieRetrievalURLCreatesCorrectURL {
2929
static NSString *const kCustomScheme = @"customscheme";
3030
static NSString *const kBundleID = @"com.My.Bundle.ID";
3131

32-
NSString *expectedURLString = [NSString stringWithFormat:
33-
@"https://goo.gl/app/_/deeplink?fdl_ios_"
34-
"bundle_id=%@&fdl_ios_url_scheme=%@",
35-
kBundleID, kCustomScheme];
32+
NSString *expectedURLString = [NSString stringWithFormat:@"https://goo.gl/app/_/deeplink?fdl_ios_"
33+
"bundle_id=%@&fdl_ios_url_scheme=%@",
34+
kBundleID, kCustomScheme];
3635

3736
NSURL *url = FIRDLCookieRetrievalURL(kCustomScheme, kBundleID);
3837

@@ -149,20 +148,19 @@ - (void)testDeepLinkURLWithInviteIDDeepLinkStringWeakMatchEndpointCreatesExpecte
149148
NSString *matchType = @"unique";
150149

151150
NSString *expectedURLString =
152-
[NSString stringWithFormat:
153-
@"%@://google/link/?utm_campaign=%@"
154-
@"&deep_link_id=%@&utm_medium=%@&invitation_weakMatchEndpoint=%@"
155-
@"&utm_source=%@&invitation_id=%@&match_type=%@",
156-
kURLScheme, utmCampaign, encodedDeepLinkString, utmMedium, weakMatchEndpoint,
157-
utmSource, inviteID, matchType];
151+
[NSString stringWithFormat:@"%@://google/link/?utm_campaign=%@"
152+
@"&deep_link_id=%@&utm_medium=%@&invitation_weakMatchEndpoint=%@"
153+
@"&utm_source=%@&invitation_id=%@&match_type=%@",
154+
kURLScheme, utmCampaign, encodedDeepLinkString, utmMedium,
155+
weakMatchEndpoint, utmSource, inviteID, matchType];
158156
NSURLComponents *expectedURLComponents = [NSURLComponents componentsWithString:expectedURLString];
159157

160158
NSURL *actualURL =
161159
FIRDLDeepLinkURLWithInviteID(inviteID, deepLinkString, utmSource, utmMedium, utmCampaign, NO,
162160
weakMatchEndpoint, nil, kURLScheme, nil);
163161

164-
NSURLComponents *actualURLComponents =
165-
[NSURLComponents componentsWithURL:actualURL resolvingAgainstBaseURL:NO];
162+
NSURLComponents *actualURLComponents = [NSURLComponents componentsWithURL:actualURL
163+
resolvingAgainstBaseURL:NO];
166164

167165
// Since the parameters are not guaranteed to be in any specific order, we must compare
168166
// arrays of properties of the URLs rather than the URLs themselves.

Example/Shared/FIRSampleAppUtilities.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@
2626
NSString *const kGithubRepoURLString = @"https://github.com/firebase/firebase-ios-sdk/";
2727
// Alert contents
2828
NSString *const kInvalidPlistAlertTitle = @"GoogleService-Info.plist";
29-
NSString *const kInvalidPlistAlertMessage =
30-
@"This sample app needs to be updated with a valid "
31-
@"GoogleService-Info.plist file in order to configure "
32-
@"Firebase.\n\n"
33-
@"Please update the app with a valid plist file, "
34-
@"following the instructions in the Firebase Github "
35-
@"repository at: %@";
29+
NSString *const kInvalidPlistAlertMessage = @"This sample app needs to be updated with a valid "
30+
@"GoogleService-Info.plist file in order to configure "
31+
@"Firebase.\n\n"
32+
@"Please update the app with a valid plist file, "
33+
@"following the instructions in the Firebase Github "
34+
@"repository at: %@";
3635

3736
@implementation FIRSampleAppUtilities
3837

@@ -52,8 +51,8 @@ + (BOOL)containsRealServiceInfoPlistInBundle:(NSBundle *)bundle {
5251
return NO;
5352
}
5453

55-
NSString *plistFilePath =
56-
[bundle pathForResource:kServiceInfoFileName ofType:kServiceInfoFileType];
54+
NSString *plistFilePath = [bundle pathForResource:kServiceInfoFileName
55+
ofType:kServiceInfoFileType];
5756
if (!plistFilePath.length) {
5857
return NO;
5958
}
@@ -91,8 +90,9 @@ + (void)presentAlertForInvalidServiceInfoPlistFromViewController:
9190
}];
9291
[alertController addAction:viewReadmeAction];
9392

94-
UIAlertAction *cancelAction =
95-
[UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleCancel handler:nil];
93+
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Close"
94+
style:UIAlertActionStyleCancel
95+
handler:nil];
9696
[alertController addAction:cancelAction];
9797

9898
[viewController presentViewController:alertController animated:YES completion:nil];

Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ - (void)setUp {
6969
XCTestExpectation *expectation = [self expectationWithDescription:@"setup"];
7070

7171
FIRStorageReference *ref = [[FIRStorage storage].reference child:@"ios/public/1mb"];
72-
NSData *data = [NSData
73-
dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1mb" ofType:@"dat"]];
72+
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1mb"
73+
ofType:@"dat"]];
7474
XCTAssertNotNil(data, "Could not load bundled file");
7575
[ref putData:data
7676
metadata:nil

Example/Storage/Tests/Unit/FIRStorageComponentTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ - (void)testMultipleComponentInstancesCreated {
6464
// App isn't used in any of this, so a simple class mock works for simplicity.
6565
id app = OCMClassMock([FIRApp class]);
6666
NSMutableSet *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
67-
FIRComponentContainer *container =
68-
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
67+
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
68+
registrants:registrants];
6969
id<FIRStorageMultiBucketProvider> provider1 =
7070
FIR_COMPONENT(FIRStorageMultiBucketProvider, container);
7171
XCTAssertNotNil(provider1);
@@ -84,8 +84,8 @@ - (void)testMultipleStorageInstancesCreated {
8484
// implementation.
8585
id app = [self appMockWithOptions];
8686
NSMutableSet *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
87-
FIRComponentContainer *container =
88-
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
87+
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
88+
registrants:registrants];
8989
id<FIRStorageMultiBucketProvider> provider =
9090
FIR_COMPONENT(FIRStorageMultiBucketProvider, container);
9191
XCTAssertNotNil(provider);

Example/Storage/Tests/Unit/FIRStorageTestHelpers.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ + (FIRApp *)mockedApp {
4545
// correct contents.
4646
id app = OCMClassMock([FIRApp class]);
4747
NSMutableSet<Class> *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
48-
FIRComponentContainer *container =
49-
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
48+
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
49+
registrants:registrants];
5050
OCMStub([app container]).andReturn(container);
5151
return app;
5252
}

Example/Storage/Tests/Unit/FIRStorageTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ - (void)testBucketNotEnforced {
5757
}
5858

5959
- (void)testBucketEnforced {
60-
FIRStorage *storage =
61-
[FIRStorage storageForApp:self.app URL:@"gs://benwu-test1.storage.firebase.com"];
60+
FIRStorage *storage = [FIRStorage storageForApp:self.app
61+
URL:@"gs://benwu-test1.storage.firebase.com"];
6262
[storage referenceForURL:@"gs://benwu-test1.storage.firebase.com/child"];
6363
storage = [FIRStorage storageForApp:self.app URL:@"gs://benwu-test1.storage.firebase.com/"];
6464
[storage referenceForURL:@"gs://benwu-test1.storage.firebase.com/child"];

Example/Storage/Tests/Unit/FIRStorageTokenAuthorizerTests.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ - (void)setUp {
3232
self.fetcher = [GTMSessionFetcher fetcherWithRequest:fetchRequest];
3333

3434
GTMSessionFetcherService *fetcherService = [[GTMSessionFetcherService alloc] init];
35-
FIRAuthInteropFake *auth =
36-
[[FIRAuthInteropFake alloc] initWithToken:kFIRStorageTestAuthToken userID:nil error:nil];
35+
FIRAuthInteropFake *auth = [[FIRAuthInteropFake alloc] initWithToken:kFIRStorageTestAuthToken
36+
userID:nil
37+
error:nil];
3738
self.fetcher.authorizer = [[FIRStorageTokenAuthorizer alloc] initWithGoogleAppID:@"dummyAppID"
3839
fetcherService:fetcherService
3940
authProvider:auth];
@@ -78,8 +79,9 @@ - (void)testUnsuccessfulAuth {
7879
NSError *authError = [NSError errorWithDomain:FIRStorageErrorDomain
7980
code:FIRStorageErrorCodeUnauthenticated
8081
userInfo:nil];
81-
FIRAuthInteropFake *failedAuth =
82-
[[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:authError];
82+
FIRAuthInteropFake *failedAuth = [[FIRAuthInteropFake alloc] initWithToken:nil
83+
userID:nil
84+
error:authError];
8385
GTMSessionFetcherService *fetcherService = [[GTMSessionFetcherService alloc] init];
8486
self.fetcher.authorizer = [[FIRStorageTokenAuthorizer alloc] initWithGoogleAppID:@"dummyAppID"
8587
fetcherService:fetcherService

0 commit comments

Comments
 (0)