aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/tests/InteropTests.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-12-06 22:41:03 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-12-06 22:41:03 -0800
commitf0f6e03212837c67d7e078e6f33074e80aa4bcc0 (patch)
tree28cf8e66afe60a741dda4fe07db29ff65dac6919 /src/objective-c/tests/InteropTests.m
parent1a9404876ce0315fc05fe82465dc389600db0965 (diff)
clang-format
Diffstat (limited to 'src/objective-c/tests/InteropTests.m')
-rw-r--r--src/objective-c/tests/InteropTests.m73
1 files changed, 39 insertions, 34 deletions
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m
index d17a07f929..3665e9705d 100644
--- a/src/objective-c/tests/InteropTests.m
+++ b/src/objective-c/tests/InteropTests.m
@@ -249,8 +249,10 @@ BOOL isRemoteInteropTest(NSString *host) {
- (void)testLargeUnaryRPCWithV2API {
XCTAssertNotNil([[self class] host]);
- __weak XCTestExpectation *expectRecvMessage = [self expectationWithDescription:@"LargeUnaryWithV2API received message"];
- __weak XCTestExpectation *expectRecvComplete = [self expectationWithDescription:@"LargeUnaryWithV2API received complete"];
+ __weak XCTestExpectation *expectRecvMessage =
+ [self expectationWithDescription:@"LargeUnaryWithV2API received message"];
+ __weak XCTestExpectation *expectRecvComplete =
+ [self expectationWithDescription:@"LargeUnaryWithV2API received complete"];
RMTSimpleRequest *request = [RMTSimpleRequest message];
request.responseType = RMTPayloadType_Compressable;
@@ -263,24 +265,26 @@ BOOL isRemoteInteropTest(NSString *host) {
options.hostNameOverride = [[self class] hostNameOverride];
GRPCUnaryProtoCall *call = [_service
- unaryCallWithMessage:request
- responseHandler:[[InteropTestsBlockCallbacks alloc] initWithInitialMetadataCallback:nil
- messageCallback:^(id message) {
- XCTAssertNotNil(message);
- if (message) {
- RMTSimpleResponse *expectedResponse = [RMTSimpleResponse message];
- expectedResponse.payload.type = RMTPayloadType_Compressable;
- expectedResponse.payload.body = [NSMutableData dataWithLength:314159];
- XCTAssertEqualObjects(message, expectedResponse);
-
- [expectRecvMessage fulfill];
- }
- }
- closeCallback:^(NSDictionary *trailingMetadata, NSError *error) {
- XCTAssertNil(error, @"Unexpected error: %@", error);
- [expectRecvComplete fulfill];
- }]
- callOptions:options];
+ unaryCallWithMessage:request
+ responseHandler:[[InteropTestsBlockCallbacks alloc] initWithInitialMetadataCallback:nil
+ messageCallback:^(id message) {
+ XCTAssertNotNil(message);
+ if (message) {
+ RMTSimpleResponse *expectedResponse =
+ [RMTSimpleResponse message];
+ expectedResponse.payload.type = RMTPayloadType_Compressable;
+ expectedResponse.payload.body =
+ [NSMutableData dataWithLength:314159];
+ XCTAssertEqualObjects(message, expectedResponse);
+
+ [expectRecvMessage fulfill];
+ }
+ }
+ closeCallback:^(NSDictionary *trailingMetadata, NSError *error) {
+ XCTAssertNil(error, @"Unexpected error: %@", error);
+ [expectRecvComplete fulfill];
+ }]
+ callOptions:options];
[call start];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil];
}
@@ -602,7 +606,8 @@ BOOL isRemoteInteropTest(NSString *host) {
- (void)testCancelAfterBeginRPCWithV2API {
XCTAssertNotNil([[self class] host]);
- __weak XCTestExpectation *expectation = [self expectationWithDescription:@"CancelAfterBeginWithV2API"];
+ __weak XCTestExpectation *expectation =
+ [self expectationWithDescription:@"CancelAfterBeginWithV2API"];
// A buffered pipe to which we never write any value acts as a writer that just hangs.
__block GRPCStreamingProtoCall *call = [_service
@@ -699,7 +704,7 @@ BOOL isRemoteInteropTest(NSString *host) {
- (void)testCancelAfterFirstRequestWithV2API {
XCTAssertNotNil([[self class] host]);
__weak XCTestExpectation *completionExpectation =
- [self expectationWithDescription:@"Call completed."];
+ [self expectationWithDescription:@"Call completed."];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = self.class.transportType;
@@ -707,20 +712,20 @@ BOOL isRemoteInteropTest(NSString *host) {
options.hostNameOverride = [[self class] hostNameOverride];
id request =
- [RMTStreamingOutputCallRequest messageWithPayloadSize:@21782 requestedResponseSize:@31415];
+ [RMTStreamingOutputCallRequest messageWithPayloadSize:@21782 requestedResponseSize:@31415];
__block GRPCStreamingProtoCall *call = [_service
- fullDuplexCallWithResponseHandler:[[InteropTestsBlockCallbacks alloc]
- initWithInitialMetadataCallback:nil
- messageCallback:^(id message) {
- XCTFail(@"Received unexpected response.");
- }
- closeCallback:^(NSDictionary *trailingMetadata,
- NSError *error) {
- XCTAssertEqual(error.code, GRPC_STATUS_CANCELLED);
- [completionExpectation fulfill];
- }]
- callOptions:options];
+ fullDuplexCallWithResponseHandler:[[InteropTestsBlockCallbacks alloc]
+ initWithInitialMetadataCallback:nil
+ messageCallback:^(id message) {
+ XCTFail(@"Received unexpected response.");
+ }
+ closeCallback:^(NSDictionary *trailingMetadata,
+ NSError *error) {
+ XCTAssertEqual(error.code, GRPC_STATUS_CANCELLED);
+ [completionExpectation fulfill];
+ }]
+ callOptions:options];
[call start];
[call writeMessage:request];
[call cancel];