Commit a7d5be6a authored by Yilun Chong's avatar Yilun Chong

change php objc nodejs csharp ruby

parent fcb92682
......@@ -50,7 +50,7 @@ function doTest(request) {
switch (request.getPayloadCase()) {
case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: {
if (request.getMessageType() == "proto3") {
if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") {
try {
testMessage = test_messages_proto3.TestAllTypes.deserializeBinary(
request.getProtobufPayload());
......@@ -58,7 +58,7 @@ function doTest(request) {
response.setParseError(err.toString());
return response;
}
} else if (request.getMessageType() == "proto2"){
} else if (request.getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2"){
response.setSkipped("NodeJS doesn\'t support proto2");
return response;
} else {
......
......@@ -71,7 +71,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
break;
case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
if ([request.messageType isEqualToString:@"proto3"]) {
if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypes"]) {
NSError *error = nil;
testMessage = [TestAllTypes parseFromData:request.protobufPayload
error:&error];
......@@ -79,7 +79,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
response.parseError =
[NSString stringWithFormat:@"Parse error: %@", error];
}
} else if ([request.messageType isEqualToString:@"proto2"]) {
} else if ([request.messageType isEqualToString:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) {
response.skipped = @"ObjC doesn't support proto2";
break;
} else {
......
......@@ -45,14 +45,14 @@ function doTest($request)
$test_message = new \Protobuf_test_messages\Proto3\TestAllTypes();
$response = new \Conformance\ConformanceResponse();
if ($request->getPayload() == "protobuf_payload") {
if ($request->getMessageType() == "proto3") {
if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypes") {
try {
$test_message->mergeFromString($request->getProtobufPayload());
} catch (Exception $e) {
$response->setParseError($e->getMessage());
return $response;
}
} elseif ($request->getMessageType() == "proto2") {
} elseif ($request->getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2") {
$response->setSkipped("PHP doesn't support proto2");
return $response;
} else {
......
......@@ -43,7 +43,7 @@ def do_test(request)
begin
case request.payload
when :protobuf_payload
if request.message_type.eql?('proto3')
if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypes')
begin
test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode(
request.protobuf_payload)
......@@ -51,7 +51,7 @@ def do_test(request)
response.parse_error = err.message.encode('utf-8')
return response
end
elsif request.message_type.eql?('proto2')
elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2')
response.skipped = "Ruby doesn't support proto2"
return response
else
......
......@@ -91,22 +91,21 @@ namespace Google.Protobuf.Conformance
message = parser.Parse<ProtobufTestMessages.Proto3.TestAllTypes>(request.JsonPayload);
break;
case ConformanceRequest.PayloadOneofCase.ProtobufPayload:
{
if (request.MessageType.Equals("proto3"))
{
message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload);
}
else if (request.MessageType.Equals("proto2"))
{
return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" };
}
else
{
throw new Exception(" Protobuf request doesn't have specific payload type");
}
break;
}
{
if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypes"))
{
message = ProtobufTestMessages.Proto3.TestAllTypes.Parser.ParseFrom(request.ProtobufPayload);
}
else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2"))
{
return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" };
}
else
{
throw new Exception(" Protobuf request doesn't have specific payload type");
}
break;
}
default:
throw new Exception("Unsupported request payload: " + request.PayloadCase);
}
......
......@@ -181,21 +181,21 @@ message TestAllTypesProto2 {
optional int32 Field_name18__ = 418;
// message_set test case.
message mset_correct {
message MessageSetCorrect {
option message_set_wire_format = true;
extensions 4 to max;
}
message mset_correct_extension1 {
extend mset_correct {
optional mset_correct_extension1 message_set_extension = 1547769;
message MessageSetCorrectExtension1 {
extend MessageSetCorrect {
optional MessageSetCorrectExtension1 message_set_extension = 1547769;
}
optional string str = 25;
}
message mset_correct_extension2 {
extend mset_correct {
optional mset_correct_extension1 message_set_extension = 4135312;
message MessageSetCorrectExtension2 {
extend MessageSetCorrect {
optional MessageSetCorrectExtension2 message_set_extension = 4135312;
}
optional int32 i = 9;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment