Skip to content

Commit

Permalink
add objec support
Browse files Browse the repository at this point in the history
  • Loading branch information
BSBandme committed Jun 28, 2017
1 parent 5e7e2d3 commit 06c9057
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions conformance/conformance_objc.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ static void Die(NSString *format, ...) {
break;

case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
NSError *error = nil;
testMessage = [TestAllTypes parseFromData:request.protobufPayload
error:&error];
if (!testMessage) {
response.parseError =
[NSString stringWithFormat:@"Parse error: %@", error];
if ([request.messageType isEqualToString:@"proto3"]) {
NSError *error = nil;
testMessage = [TestAllTypes parseFromData:request.protobufPayload
error:&error];
if (!testMessage) {
response.parseError =
[NSString stringWithFormat:@"Parse error: %@", error];
}
} else if ([request.messageType isEqualToString:@"proto2"]) {
response.skipped = @"ObjC doesn't support proto2";
break;
} else {
Die(@"Protobuf request doesn't have specific payload type");
break;
}
break;
}
Expand Down

0 comments on commit 06c9057

Please sign in to comment.