aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/examples/Sample
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-05-15 14:52:57 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-05-15 14:52:57 -0700
commit343bea6b54f7ebf7a2f19e351bff8e39e4d07193 (patch)
tree2bd64274ffc5ff813fa9016e25a26ccd4f61feb6 /src/objective-c/examples/Sample
parent1602c5ffd41df719670efaf44236fa0a8b4a4dfd (diff)
Fixed cancellation tests
Diffstat (limited to 'src/objective-c/examples/Sample')
-rw-r--r--src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m b/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m
index 6313e32483..ee9e287966 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