add objec support

pull/3281/head
Yilun Chong 8 years ago
parent 5e7e2d3bb8
commit 06c9057cc3
  1. 20
      conformance/conformance_objc.m

@ -71,12 +71,20 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
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;
}

Loading…
Cancel
Save