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
37dbfd6c
Commit
37dbfd6c
authored
Dec 15, 2018
by
Hao Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not require ruby enum to be uppercase
parent
00b9b230
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
23 deletions
+6
-23
binary_json_conformance_suite.cc
conformance/binary_json_conformance_suite.cc
+0
-17
message.c
ruby/ext/google/protobuf_c/message.c
+6
-6
No files found.
conformance/binary_json_conformance_suite.cc
View file @
37dbfd6c
...
...
@@ -1387,23 +1387,6 @@ void BinaryAndJsonConformanceSuite::RunSuiteImpl() {
R"({"optionalNestedEnum": "FOO"})"
,
"optional_nested_enum: FOO"
);
// Enum fields with alias
RunValidJsonTest
(
"EnumFieldWithAlias"
,
REQUIRED
,
R"({"optionalAliasedEnum": "ALIAS_BAZ"})"
,
"optional_aliased_enum: ALIAS_BAZ"
);
RunValidJsonTest
(
"EnumFieldWithAliasUseAlias"
,
REQUIRED
,
R"({"optionalAliasedEnum": "QUX"})"
,
"optional_aliased_enum: ALIAS_BAZ"
);
RunValidJsonTest
(
"EnumFieldWithAliasLowerCase"
,
REQUIRED
,
R"({"optionalAliasedEnum": "qux"})"
,
"optional_aliased_enum: ALIAS_BAZ"
);
RunValidJsonTest
(
"EnumFieldWithAliasDifferentCase"
,
REQUIRED
,
R"({"optionalAliasedEnum": "bAz"})"
,
"optional_aliased_enum: ALIAS_BAZ"
);
// Enum fields with alias
RunValidJsonTest
(
"EnumFieldWithAlias"
,
REQUIRED
,
R"({"optionalAliasedEnum": "ALIAS_BAZ"})"
,
...
...
ruby/ext/google/protobuf_c/message.c
View file @
37dbfd6c
...
...
@@ -697,12 +697,12 @@ VALUE build_module_from_enumdesc(EnumDescriptor* enumdesc) {
upb_enum_next
(
&
it
))
{
const
char
*
name
=
upb_enum_iter_name
(
&
it
);
int32_t
value
=
upb_enum_iter_number
(
&
it
);
if
(
name
[
0
]
<
'A'
||
name
[
0
]
>
'Z'
)
{
rb_raise
(
cTypeError
,
"Enum value '%s' does not start with an uppercase letter "
"as is required for Ruby constants."
,
name
);
}
//
if (name[0] < 'A' || name[0] > 'Z') {
//
rb_raise(cTypeError,
//
"Enum value '%s' does not start with an uppercase letter "
//
"as is required for Ruby constants.",
//
name);
//
}
rb_define_const
(
mod
,
name
,
INT2NUM
(
value
));
}
...
...
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