diff --git a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m b/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m index 6313e32483c32fbaa772d5e305568f07083683e1..ee9e287966ebab85a148c3d6006152d8508af289 100644 --- a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m +++ b/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