|
|
@@ -203,11 +203,11 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
data:(NSDictionary<NSString *, id> *)data {
|
|
|
__block NSError *errorResult;
|
|
|
XCTestExpectation *expectation = [_testCase expectationWithDescription:@"prepareDoc:set"];
|
|
|
- [_docRef setData:data
|
|
|
- completion:^(NSError *error) {
|
|
|
- errorResult = error;
|
|
|
- [expectation fulfill];
|
|
|
- }];
|
|
|
+ [ref setData:data
|
|
|
+ completion:^(NSError *error) {
|
|
|
+ errorResult = error;
|
|
|
+ [expectation fulfill];
|
|
|
+ }];
|
|
|
[_testCase awaitExpectations];
|
|
|
return errorResult;
|
|
|
}
|
|
|
@@ -216,13 +216,13 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
XCTestExpectation *expectation =
|
|
|
[_testCase expectationWithDescription:@"runSuccessfulTransaction"];
|
|
|
[_db
|
|
|
- runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **error) {
|
|
|
+ runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **) {
|
|
|
for (TransactionStage stage in self->_stages) {
|
|
|
stage(transaction, self->_docRef);
|
|
|
}
|
|
|
return @YES;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *error) {
|
|
|
[expectation fulfill];
|
|
|
NSString *message =
|
|
|
[NSString stringWithFormat:@"Expected the sequence %@, to succeed, but got %d.",
|
|
|
@@ -237,13 +237,13 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
XCTestExpectation *expectation =
|
|
|
[_testCase expectationWithDescription:@"runFailingTransactionWithError"];
|
|
|
[_db
|
|
|
- runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **error) {
|
|
|
+ runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **) {
|
|
|
for (TransactionStage stage in self->_stages) {
|
|
|
stage(transaction, self->_docRef);
|
|
|
}
|
|
|
return @YES;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
[expectation fulfill];
|
|
|
NSString *message =
|
|
|
[NSString stringWithFormat:@"Expected the sequence (%@), to fail, but it didn't.",
|
|
|
@@ -363,7 +363,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
|
|
|
XCTestExpectation *expectation = [self expectationWithDescription:@"transaction"];
|
|
|
[firestore
|
|
|
- runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **error) {
|
|
|
+ runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **) {
|
|
|
[transaction setData:@{@"a" : @"b", @"nested" : @{@"a" : @"b"}} forDocument:doc];
|
|
|
[transaction setData:@{@"c" : @"d", @"nested" : @{@"c" : @"d"}} forDocument:doc merge:YES];
|
|
|
return @YES;
|
|
|
@@ -414,7 +414,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction setData:@{@"count" : @(newCount)} forDocument:doc];
|
|
|
return @YES;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *) {
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
}
|
|
|
@@ -461,7 +461,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction updateData:@{@"count" : @(newCount)} forDocument:doc];
|
|
|
return @YES;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *) {
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
}
|
|
|
@@ -501,7 +501,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[doc1 setData:@{
|
|
|
@"count" : @(1234)
|
|
|
}
|
|
|
- completion:^(NSError *_Nullable error) {
|
|
|
+ completion:^(NSError *) {
|
|
|
dispatch_semaphore_signal(writeSemaphore);
|
|
|
}];
|
|
|
// We can block on it, because transactions run on a background queue.
|
|
|
@@ -511,7 +511,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction setData:@{@"count" : @(16)} forDocument:doc2];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
XCTAssertNil(error);
|
|
|
XCTAssertEqual(counter->load(), 2);
|
|
|
[expectation fulfill];
|
|
|
@@ -544,7 +544,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[doc setData:@{
|
|
|
@"count" : @(1234 + (int)(*counter))
|
|
|
}
|
|
|
- completion:^(NSError *_Nullable error) {
|
|
|
+ completion:^(NSError *) {
|
|
|
dispatch_semaphore_signal(writeSemaphore);
|
|
|
}];
|
|
|
// We can block on it, because transactions run on a background queue.
|
|
|
@@ -558,7 +558,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
XCTAssertNotNil(*error);
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
[expectation fulfill];
|
|
|
XCTAssertNotNil(error);
|
|
|
XCTAssertEqual(error.code, FIRFirestoreErrorCodeAborted);
|
|
|
@@ -581,7 +581,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[doc setData:@{
|
|
|
@"count" : @(1234)
|
|
|
}
|
|
|
- completion:^(NSError *_Nullable error) {
|
|
|
+ completion:^(NSError *) {
|
|
|
dispatch_semaphore_signal(writeSemaphore);
|
|
|
}];
|
|
|
// We can block on it, because transactions run on a background queue.
|
|
|
@@ -592,7 +592,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction updateData:@{@"count" : @(16)} forDocument:doc];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
[expectation fulfill];
|
|
|
XCTAssertNotNil(error);
|
|
|
XCTAssertEqual(error.code, FIRFirestoreErrorCodeInvalidArgument);
|
|
|
@@ -613,7 +613,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction getDocument:doc error:error];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
XCTAssertNil(error);
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
@@ -638,7 +638,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
[transaction updateData:@{@"count" : @(16)} forDocument:doc];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
+ completion:^(id, NSError *_Nullable error) {
|
|
|
[expectation fulfill];
|
|
|
XCTAssertNotNil(error);
|
|
|
XCTAssertEqual(error.code, FIRFirestoreErrorCodeInvalidArgument);
|
|
|
@@ -651,7 +651,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
FIRFirestore *firestore = [self firestore];
|
|
|
XCTestExpectation *expectation = [self expectationWithDescription:@"transaction"];
|
|
|
[firestore
|
|
|
- runTransactionWithBlock:^id _Nullable(FIRTransaction *transaction, NSError **error) {
|
|
|
+ runTransactionWithBlock:^id _Nullable(FIRTransaction *, NSError **) {
|
|
|
return @"yes";
|
|
|
}
|
|
|
completion:^(id _Nullable result, NSError *_Nullable error) {
|
|
|
@@ -704,7 +704,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
forDocument:doc];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id result, NSError *error) {
|
|
|
+ completion:^(id, NSError *error) {
|
|
|
XCTAssertNil(error);
|
|
|
[doc getDocumentWithCompletion:^(FIRDocumentSnapshot *snapshot, NSError *error) {
|
|
|
XCTAssertNil(error);
|
|
|
@@ -737,7 +737,7 @@ TransactionStage get = ^(FIRTransaction *transaction, FIRDocumentReference *doc)
|
|
|
forDocument:doc];
|
|
|
return nil;
|
|
|
}
|
|
|
- completion:^(id result, NSError *error) {
|
|
|
+ completion:^(id, NSError *error) {
|
|
|
XCTAssertNil(error);
|
|
|
[doc getDocumentWithCompletion:^(FIRDocumentSnapshot *snapshot, NSError *error) {
|
|
|
XCTAssertNil(error);
|