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
1ea52687
Commit
1ea52687
authored
Dec 02, 2008
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add full-system test for custom enum value options. (Previously, only a
parsing test in parser_unittest.cc existed.)
parent
2f669cbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
descriptor_unittest.cc
src/google/protobuf/descriptor_unittest.cc
+3
-0
unittest_custom_options.proto
src/google/protobuf/unittest_custom_options.proto
+4
-2
No files found.
src/google/protobuf/descriptor_unittest.cc
View file @
1ea52687
...
...
@@ -1554,6 +1554,9 @@ TEST(CustomOptions, OptionLocations) {
field
->
options
().
GetExtension
(
protobuf_unittest
::
field_opt2
));
EXPECT_EQ
(
-
789
,
enm
->
options
().
GetExtension
(
protobuf_unittest
::
enum_opt1
));
EXPECT_EQ
(
123
,
enm
->
value
(
1
)
->
options
().
GetExtension
(
protobuf_unittest
::
enum_value_opt1
));
EXPECT_EQ
(
GOOGLE_LONGLONG
(
-
9876543210
),
service
->
options
().
GetExtension
(
protobuf_unittest
::
service_opt1
));
EXPECT_EQ
(
protobuf_unittest
::
METHODOPT1_VAL2
,
...
...
src/google/protobuf/unittest_custom_options.proto
View file @
1ea52687
...
...
@@ -66,7 +66,9 @@ extend google.protobuf.EnumOptions {
optional
sfixed32
enum_opt1
=
7753576
;
}
// TODO(benjy): Test options on enum values when the parser supports them.
extend
google
.
protobuf.EnumValueOptions
{
optional
int32
enum_value_opt1
=
1560678
;
}
extend
google
.
protobuf.ServiceOptions
{
optional
sint64
service_opt1
=
7887650
;
...
...
@@ -95,7 +97,7 @@ message TestMessageWithCustomOptions {
option
(
enum_opt1
)
=
-
789
;
ANENUM_VAL1
=
1
;
ANENUM_VAL2
=
2
;
ANENUM_VAL2
=
2
[(
enum_value_opt1
)
=
123
]
;
}
}
...
...
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