Skip to content

Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/2018-08-24) #2222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: osx
osx_image: xcode10
osx_image: xcode10.1
language: objective-c
cache:
- bundler
Expand Down
8 changes: 2 additions & 6 deletions Example/Core/Tests/FIRAnalyticsConfigurationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,15 @@ - (void)testSettingAnalyticsCollectionEnabled {
[self.observerMock setExpectationOrderMatters:YES];
[[self.observerMock expect] notificationWithName:notificationName
object:config
userInfo:@{
notificationName : @YES
}];
userInfo:@{notificationName : @YES}];

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

// Expect the second notification.
[[self.observerMock expect] notificationWithName:notificationName
object:config
userInfo:@{
notificationName : @NO
}];
userInfo:@{notificationName : @NO}];

// Test setting to disabled.
[config setAnalyticsCollectionEnabled:NO];
Expand Down
148 changes: 74 additions & 74 deletions Example/Core/Tests/FIRAppTest.m

Large diffs are not rendered by default.

64 changes: 27 additions & 37 deletions Example/Core/Tests/FIROptionsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ - (void)testDefaultOptions {
}

- (void)testInitCustomizedOptions {
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
options.APIKey = kAPIKey;
options.bundleID = kBundleID;
options.clientID = kClientID;
Expand All @@ -98,8 +98,8 @@ - (void)testInitCustomizedOptions {
}

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

- (void)testCopyingProperties {
NSMutableString *mutableString;
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.APIKey = mutableString;
[mutableString appendString:@"2"];
Expand Down Expand Up @@ -208,8 +208,8 @@ - (void)testCopyWithZone {
XCTAssertEqualObjects(newOptions.deepLinkURLScheme, kDeepLinkURLScheme);

// customized options
FIROptions *customizedOptions =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *customizedOptions = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
customizedOptions.deepLinkURLScheme = kDeepLinkURLScheme;
FIROptions *copyCustomizedOptions = [customizedOptions copy];
[copyCustomizedOptions setDeepLinkURLScheme:kNewDeepLinkURLScheme];
Expand Down Expand Up @@ -466,20 +466,16 @@ - (void)testAnalyticsCollectionGlobalSwitchOverrideToDisable {
OCMStub([appMock isDataCollectionDefaultEnabled]).andReturn(YES);

// Test the three Analytics flags that override to disable Analytics collection.
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionEnabled : @NO
}];
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @NO}];
XCTAssertFalse(collectionEnabledOptions.isAnalyticsCollectionEnabled);

FIROptions *collectionDeactivatedOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionDeactivated : @YES
}];
FIROptions *collectionDeactivatedOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionDeactivated : @YES}];
XCTAssertFalse(collectionDeactivatedOptions.isAnalyticsCollectionEnabled);

FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
FIROptions *measurementEnabledOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertFalse(measurementEnabledOptions.isAnalyticsCollectionEnabled);
}

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

// Test the two Analytics flags that can override and enable collection.
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionEnabled : @YES
}];
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @YES}];
XCTAssertTrue(collectionEnabledOptions.isAnalyticsCollectionEnabled);

FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsMeasurementEnabled : @YES
}];
FIROptions *measurementEnabledOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @YES}];
XCTAssertTrue(measurementEnabledOptions.isAnalyticsCollectionEnabled);
}

Expand Down Expand Up @@ -534,31 +528,27 @@ - (void)testAnalyticsCollectionExplicitlySet {

// Test the old measurement flag.
options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @YES
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @YES}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);

options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);

// For good measure, a combination of all 3 (even if they conflict).
optionsDictionary =
@{kFIRIsAnalyticsCollectionDeactivated : @YES,
kFIRIsAnalyticsCollectionEnabled : @YES};
@{kFIRIsAnalyticsCollectionDeactivated : @YES, kFIRIsAnalyticsCollectionEnabled : @YES};
options = [[FIROptions alloc] initInternalWithOptionsDictionary:optionsDictionary];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);
}

- (void)testModifyingOptionsThrows {
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
options.editingLocked = YES;

// Modification to every property should result in an exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ @implementation FDLBuilderTestAppObjCEarlGreyTests
- (void)testOpenFDLFromAppGeneratedLink {
// On first launch, a null FDL Received alert is displayed (by design); in
// this case, we need to dismiss it in order to proceed
BOOL hasFirstInstallAlertDisplayed =
[self confirmPresenceOfFDLAlertWithURL:@"(null)" matchType:@"0" minimumAppVersion:@"(null)"];
BOOL hasFirstInstallAlertDisplayed = [self confirmPresenceOfFDLAlertWithURL:@"(null)"
matchType:@"0"
minimumAppVersion:@"(null)"];
if (hasFirstInstallAlertDisplayed) {
[[EarlGrey selectElementWithMatcher:[GREYMatchers matcherForText:@"Dismiss"]]
performAction:grey_tap()];
Expand Down
5 changes: 3 additions & 2 deletions Example/DynamicLinks/Tests/FDLURLComponentsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ - (void)testAnalyticsParamsDictionaryRepresentationReturnsCorrectDictionaryEmpty
}

- (void)testAnalyticsParamsFactoryWithParamsReturnsInstanceOfCorrectClass {
id returnValue =
[FIRDynamicLinkGoogleAnalyticsParameters parametersWithSource:@"s" medium:@"m" campaign:@"c"];
id returnValue = [FIRDynamicLinkGoogleAnalyticsParameters parametersWithSource:@"s"
medium:@"m"
campaign:@"c"];
XCTAssertTrue([returnValue isKindOfClass:[FIRDynamicLinkGoogleAnalyticsParameters class]]);
}

Expand Down
22 changes: 10 additions & 12 deletions Example/DynamicLinks/Tests/UtilitiesTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ - (void)testFDLCookieRetrievalURLCreatesCorrectURL {
static NSString *const kCustomScheme = @"customscheme";
static NSString *const kBundleID = @"com.My.Bundle.ID";

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

NSURL *url = FIRDLCookieRetrievalURL(kCustomScheme, kBundleID);

Expand Down Expand Up @@ -149,20 +148,19 @@ - (void)testDeepLinkURLWithInviteIDDeepLinkStringWeakMatchEndpointCreatesExpecte
NSString *matchType = @"unique";

NSString *expectedURLString =
[NSString stringWithFormat:
@"%@://google/link/?utm_campaign=%@"
@"&deep_link_id=%@&utm_medium=%@&invitation_weakMatchEndpoint=%@"
@"&utm_source=%@&invitation_id=%@&match_type=%@",
kURLScheme, utmCampaign, encodedDeepLinkString, utmMedium, weakMatchEndpoint,
utmSource, inviteID, matchType];
[NSString stringWithFormat:@"%@://google/link/?utm_campaign=%@"
@"&deep_link_id=%@&utm_medium=%@&invitation_weakMatchEndpoint=%@"
@"&utm_source=%@&invitation_id=%@&match_type=%@",
kURLScheme, utmCampaign, encodedDeepLinkString, utmMedium,
weakMatchEndpoint, utmSource, inviteID, matchType];
NSURLComponents *expectedURLComponents = [NSURLComponents componentsWithString:expectedURLString];

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

NSURLComponents *actualURLComponents =
[NSURLComponents componentsWithURL:actualURL resolvingAgainstBaseURL:NO];
NSURLComponents *actualURLComponents = [NSURLComponents componentsWithURL:actualURL
resolvingAgainstBaseURL:NO];

// Since the parameters are not guaranteed to be in any specific order, we must compare
// arrays of properties of the URLs rather than the URLs themselves.
Expand Down
22 changes: 11 additions & 11 deletions Example/Shared/FIRSampleAppUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
NSString *const kGithubRepoURLString = @"https://github.com/firebase/firebase-ios-sdk/";
// Alert contents
NSString *const kInvalidPlistAlertTitle = @"GoogleService-Info.plist";
NSString *const kInvalidPlistAlertMessage =
@"This sample app needs to be updated with a valid "
@"GoogleService-Info.plist file in order to configure "
@"Firebase.\n\n"
@"Please update the app with a valid plist file, "
@"following the instructions in the Firebase Github "
@"repository at: %@";
NSString *const kInvalidPlistAlertMessage = @"This sample app needs to be updated with a valid "
@"GoogleService-Info.plist file in order to configure "
@"Firebase.\n\n"
@"Please update the app with a valid plist file, "
@"following the instructions in the Firebase Github "
@"repository at: %@";

@implementation FIRSampleAppUtilities

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

NSString *plistFilePath =
[bundle pathForResource:kServiceInfoFileName ofType:kServiceInfoFileType];
NSString *plistFilePath = [bundle pathForResource:kServiceInfoFileName
ofType:kServiceInfoFileType];
if (!plistFilePath.length) {
return NO;
}
Expand Down Expand Up @@ -91,8 +90,9 @@ + (void)presentAlertForInvalidServiceInfoPlistFromViewController:
}];
[alertController addAction:viewReadmeAction];

UIAlertAction *cancelAction =
[UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Close"
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:cancelAction];

[viewController presentViewController:alertController animated:YES completion:nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ - (void)setUp {
XCTestExpectation *expectation = [self expectationWithDescription:@"setup"];

FIRStorageReference *ref = [[FIRStorage storage].reference child:@"ios/public/1mb"];
NSData *data = [NSData
dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1mb" ofType:@"dat"]];
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1mb"
ofType:@"dat"]];
XCTAssertNotNil(data, "Could not load bundled file");
[ref putData:data
metadata:nil
Expand Down
8 changes: 4 additions & 4 deletions Example/Storage/Tests/Unit/FIRStorageComponentTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ - (void)testMultipleComponentInstancesCreated {
// App isn't used in any of this, so a simple class mock works for simplicity.
id app = OCMClassMock([FIRApp class]);
NSMutableSet *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
FIRComponentContainer *container =
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
registrants:registrants];
id<FIRStorageMultiBucketProvider> provider1 =
FIR_COMPONENT(FIRStorageMultiBucketProvider, container);
XCTAssertNotNil(provider1);
Expand All @@ -84,8 +84,8 @@ - (void)testMultipleStorageInstancesCreated {
// implementation.
id app = [self appMockWithOptions];
NSMutableSet *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
FIRComponentContainer *container =
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
registrants:registrants];
id<FIRStorageMultiBucketProvider> provider =
FIR_COMPONENT(FIRStorageMultiBucketProvider, container);
XCTAssertNotNil(provider);
Expand Down
4 changes: 2 additions & 2 deletions Example/Storage/Tests/Unit/FIRStorageTestHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ + (FIRApp *)mockedApp {
// correct contents.
id app = OCMClassMock([FIRApp class]);
NSMutableSet<Class> *registrants = [NSMutableSet setWithObject:[FIRStorageComponent class]];
FIRComponentContainer *container =
[[FIRComponentContainer alloc] initWithApp:app registrants:registrants];
FIRComponentContainer *container = [[FIRComponentContainer alloc] initWithApp:app
registrants:registrants];
OCMStub([app container]).andReturn(container);
return app;
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Storage/Tests/Unit/FIRStorageTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ - (void)testBucketNotEnforced {
}

- (void)testBucketEnforced {
FIRStorage *storage =
[FIRStorage storageForApp:self.app URL:@"gs://benwu-test1.storage.firebase.com"];
FIRStorage *storage = [FIRStorage storageForApp:self.app
URL:@"gs://benwu-test1.storage.firebase.com"];
[storage referenceForURL:@"gs://benwu-test1.storage.firebase.com/child"];
storage = [FIRStorage storageForApp:self.app URL:@"gs://benwu-test1.storage.firebase.com/"];
[storage referenceForURL:@"gs://benwu-test1.storage.firebase.com/child"];
Expand Down
10 changes: 6 additions & 4 deletions Example/Storage/Tests/Unit/FIRStorageTokenAuthorizerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ - (void)setUp {
self.fetcher = [GTMSessionFetcher fetcherWithRequest:fetchRequest];

GTMSessionFetcherService *fetcherService = [[GTMSessionFetcherService alloc] init];
FIRAuthInteropFake *auth =
[[FIRAuthInteropFake alloc] initWithToken:kFIRStorageTestAuthToken userID:nil error:nil];
FIRAuthInteropFake *auth = [[FIRAuthInteropFake alloc] initWithToken:kFIRStorageTestAuthToken
userID:nil
error:nil];
self.fetcher.authorizer = [[FIRStorageTokenAuthorizer alloc] initWithGoogleAppID:@"dummyAppID"
fetcherService:fetcherService
authProvider:auth];
Expand Down Expand Up @@ -78,8 +79,9 @@ - (void)testUnsuccessfulAuth {
NSError *authError = [NSError errorWithDomain:FIRStorageErrorDomain
code:FIRStorageErrorCodeUnauthenticated
userInfo:nil];
FIRAuthInteropFake *failedAuth =
[[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:authError];
FIRAuthInteropFake *failedAuth = [[FIRAuthInteropFake alloc] initWithToken:nil
userID:nil
error:authError];
GTMSessionFetcherService *fetcherService = [[GTMSessionFetcherService alloc] init];
self.fetcher.authorizer = [[FIRStorageTokenAuthorizer alloc] initWithGoogleAppID:@"dummyAppID"
fetcherService:fetcherService
Expand Down
Loading