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
87e4976b
Commit
87e4976b
authored
8 years ago
by
Jie Luo
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2639 from anandolee/master
Add Oneof custom options test
parents
a83ac866
ccb76fff
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
unittest_custom_options_proto3.proto
csharp/protos/unittest_custom_options_proto3.proto
+4
-6
CustomOptionsTest.cs
.../src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs
+4
-0
UnittestCustomOptionsProto3.cs
...e.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
+0
-0
No files found.
csharp/protos/unittest_custom_options_proto3.proto
View file @
87e4976b
...
...
@@ -68,10 +68,9 @@ extend google.protobuf.FieldOptions {
fixed64
field_opt1
=
7740936
;
}
// See https://github.com/google/protobuf/issues/2316
// extend google.protobuf.OneofOptions {
// int32 oneof_opt1 = 7740111;
// }
extend
google
.
protobuf.OneofOptions
{
int32
oneof_opt1
=
7740111
;
}
extend
google
.
protobuf.EnumOptions
{
sfixed32
enum_opt1
=
7753576
;
...
...
@@ -106,8 +105,7 @@ message TestMessageWithCustomOptions {
(
field_opt1
)
=
8765432109
];
oneof
AnOneof
{
// See https://github.com/google/protobuf/issues/2316
// option (oneof_opt1) = -99;
option
(
oneof_opt1
)
=
-
99
;
int32
oneof_field
=
2
;
}
...
...
This diff is collapsed.
Click to expand it.
csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs
View file @
87e4976b
...
...
@@ -50,6 +50,7 @@ namespace Google.Protobuf.Test.Reflection
FileOpt1
=
7736974
,
MessageOpt1
=
7739036
,
FieldOpt1
=
7740936
,
OneofOpt1
=
7740111
,
EnumOpt1
=
7753576
,
EnumValueOpt1
=
1560678
,
ServiceOpt1
=
7887650
,
...
...
@@ -197,6 +198,9 @@ namespace Google.Protobuf.Test.Reflection
var
fieldOptions
=
TestMessageWithCustomOptions
.
Descriptor
.
Fields
[
"field1"
]
.
CustomOptions
;
AssertOption
(
8765432109U
L
,
fieldOptions
.
TryGetFixed64
,
FieldOpt1
);
var
oneofOptions
=
TestMessageWithCustomOptions
.
Descriptor
.
Oneofs
[
0
].
CustomOptions
;
AssertOption
(-
99
,
oneofOptions
.
TryGetInt32
,
OneofOpt1
);
var
enumOptions
=
TestMessageWithCustomOptions
.
Descriptor
.
EnumTypes
[
0
].
CustomOptions
;
AssertOption
(-
789
,
enumOptions
.
TryGetSFixed32
,
EnumOpt1
);
...
...
This diff is collapsed.
Click to expand it.
csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
View file @
87e4976b
This diff is collapsed.
Click to expand it.
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