Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
a7d5be6a
Commit
a7d5be6a
authored
Jun 29, 2017
by
Yilun Chong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change php objc nodejs csharp ruby
parent
fcb92682
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
31 deletions
+30
-31
conformance_nodejs.js
conformance/conformance_nodejs.js
+2
-2
conformance_objc.m
conformance/conformance_objc.m
+2
-2
conformance_php.php
conformance/conformance_php.php
+2
-2
conformance_ruby.rb
conformance/conformance_ruby.rb
+2
-2
Program.cs
csharp/src/Google.Protobuf.Conformance/Program.cs
+15
-16
test_messages_proto2.proto
src/google/protobuf/test_messages_proto2.proto
+7
-7
No files found.
conformance/conformance_nodejs.js
View file @
a7d5be6a
...
...
@@ -50,7 +50,7 @@ function doTest(request) {
switch
(
request
.
getPayloadCase
())
{
case
conformance
.
ConformanceRequest
.
PayloadCase
.
PROTOBUF_PAYLOAD
:
{
if
(
request
.
getMessageType
()
==
"proto
3
"
)
{
if
(
request
.
getMessageType
()
==
"proto
buf_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
()
==
"proto
buf_test_messages.proto2.TestAllTypesProto
2"
){
response
.
setSkipped
(
"NodeJS doesn
\
't support proto2"
);
return
response
;
}
else
{
...
...
conformance/conformance_objc.m
View file @
a7d5be6a
...
...
@@ -71,7 +71,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
break
;
case
ConformanceRequest_Payload_OneOfCase_ProtobufPayload
:
{
if
([
request
.
messageType
isEqualToString
:
@"proto
3
"
])
{
if
([
request
.
messageType
isEqualToString
:
@"proto
buf_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
:
@"proto
buf_test_messages.proto2.TestAllTypesProto
2"
])
{
response
.
skipped
=
@"ObjC doesn't support proto2"
;
break
;
}
else
{
...
...
conformance/conformance_php.php
View file @
a7d5be6a
...
...
@@ -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
()
==
"proto
3
"
)
{
if
(
$request
->
getMessageType
()
==
"proto
buf_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
()
==
"proto
buf_test_messages.proto2.TestAllTypesProto
2"
)
{
$response
->
setSkipped
(
"PHP doesn't support proto2"
);
return
$response
;
}
else
{
...
...
conformance/conformance_ruby.rb
View file @
a7d5be6a
...
...
@@ -43,7 +43,7 @@ def do_test(request)
begin
case
request
.
payload
when
:protobuf_payload
if
request
.
message_type
.
eql?
(
'proto
3
'
)
if
request
.
message_type
.
eql?
(
'proto
buf_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?
(
'proto
buf_test_messages.proto2.TestAllTypesProto
2'
)
response
.
skipped
=
"Ruby doesn't support proto2"
return
response
else
...
...
csharp/src/Google.Protobuf.Conformance/Program.cs
View file @
a7d5be6a
...
...
@@ -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
);
}
...
...
src/google/protobuf/test_messages_proto2.proto
View file @
a7d5be6a
...
...
@@ -181,21 +181,21 @@ message TestAllTypesProto2 {
optional
int32
Field_name18__
=
418
;
// message_set test case.
message
mset_c
orrect
{
message
MessageSetC
orrect
{
option
message_set_wire_format
=
true
;
extensions
4
to
max
;
}
message
mset_correct_e
xtension1
{
extend
mset_c
orrect
{
optional
mset_correct_e
xtension1
message_set_extension
=
1547769
;
message
MessageSetCorrectE
xtension1
{
extend
MessageSetC
orrect
{
optional
MessageSetCorrectE
xtension1
message_set_extension
=
1547769
;
}
optional
string
str
=
25
;
}
message
mset_correct_e
xtension2
{
extend
mset_c
orrect
{
optional
mset_correct_extension1
message_set_extension
=
4135312
;
message
MessageSetCorrectE
xtension2
{
extend
MessageSetC
orrect
{
optional
MessageSetCorrectExtension2
message_set_extension
=
4135312
;
}
optional
int32
i
=
9
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment