Skip to content

Commit

Permalink
GDT tests: Xcode 12 fixes (#6469)
Browse files Browse the repository at this point in the history
* GDT tests: Xcode 12 fixes

* Silent unused warnings for weakSelf vars (for Xcode 12)
  • Loading branch information
maksymmalyhin committed Sep 16, 2020
1 parent 2b4b9be commit cd84490
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions GoogleDataTransport/GDTCCTTests/Unit/GDTCCTUploaderTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ - (void)testStorageSelectorWhenConditionsHighPriority {
[self assertStorageSelectorWithCondition:GDTCORUploadConditionHighPriority
validationBlock:^(GDTCORStorageEventSelector *_Nullable eventSelector,
NSDate *expiration) {
id self = weakSelf;
__unused id self = weakSelf;
XCTAssertLessThan([expiration timeIntervalSinceNow], 600);
XCTAssertEqual(eventSelector.selectedTarget, kGDTCORTargetTest);
XCTAssertNil(eventSelector.selectedEventIDs);
Expand All @@ -375,7 +375,7 @@ - (void)testStorageSelectorWhenConditionsMobileData {
assertStorageSelectorWithCondition:GDTCORUploadConditionMobileData
validationBlock:^(GDTCORStorageEventSelector *_Nullable eventSelector,
NSDate *expiration) {
id self = weakSelf;
__unused id self = weakSelf;
XCTAssertLessThan([expiration timeIntervalSinceNow], 600);
XCTAssertEqual(eventSelector.selectedTarget, kGDTCORTargetTest);
XCTAssertNil(eventSelector.selectedEventIDs);
Expand All @@ -393,7 +393,7 @@ - (void)testStorageSelectorWhenConditionsWifiData {
assertStorageSelectorWithCondition:GDTCORUploadConditionWifiData
validationBlock:^(GDTCORStorageEventSelector *_Nullable eventSelector,
NSDate *expiration) {
id self = weakSelf;
__unused id self = weakSelf;
XCTAssertLessThan([expiration timeIntervalSinceNow], 600);
XCTAssertEqual(eventSelector.selectedTarget, kGDTCORTargetTest);
XCTAssertNil(eventSelector.selectedEventIDs);
Expand Down Expand Up @@ -582,7 +582,7 @@ - (XCTestExpectation *)expectStorageHasEventsForTarget:(GDTCORTarget)expectedTar
__weak __auto_type weakSelf = self;
self.testStorage.hasEventsForTargetHandler =
^(GDTCORTarget target, GDTCCTTestStorageHasEventsCompletion _Nonnull completion) {
__auto_type self = weakSelf;
__unused __auto_type self = weakSelf;
[expectation fulfill];
XCTAssertEqual(target, expectedTarget);
completion(hasEvents);
Expand Down
4 changes: 2 additions & 2 deletions GoogleDataTransport/GDTCORTests/Unit/GDTCORTransformerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ - (void)testWriteEventWithTransformersThatCreateANewEvent {

self.fakeApplication.beginTaskHandler =
^GDTCORBackgroundIdentifier(NSString *_Nonnull name, dispatch_block_t _Nonnull handler) {
__auto_type self = weakSelf;
__unused __auto_type self = weakSelf;
XCTAssertEqualObjects(expectedName, name);

[beginExpectation fulfill];
return taskID;
};

self.fakeApplication.endTaskHandler = ^(GDTCORBackgroundIdentifier endTaskID) {
__auto_type self = weakSelf;
__unused __auto_type self = weakSelf;
XCTAssert(endTaskID == taskID);
[endExpectation fulfill];
};
Expand Down

0 comments on commit cd84490

Please sign in to comment.