Fixed cancellation tests

pull/1626/head
murgatroid99 10 years ago
parent 1602c5ffd4
commit 343bea6b54
  1. 8
      src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m

@ -31,9 +31,12 @@
*
*/
#include <grpc/status.h>
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <gRPC/ProtoRPC.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <RemoteTest/Messages.pb.h>
#import <RemoteTest/Test.pb.h>
@ -177,11 +180,12 @@
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"CancelAfterBegin"];
ProtoRPC *call = [_service RPCToStreamingInputCallWithRequestsWriter:[GRXWriter writerWithContainer:@[]]
handler:^(RMTStreamingInputCallResponse *response, NSError *error) {
// TODO(mlumish): check for actual CANCELLED error code
XCTAssertEqualObjects(error, nil);
XCTAssertEqual([error code], GRPC_STATUS_CANCELLED);
[expectation fulfill];
}];
[call start];
[call cancel];
[self waitForExpectationsWithTimeout:4 handler:nil];
}
@end

Loading…
Cancel
Save