Skip to content

Commit

Permalink
Add binary conformance test for enum fields. (#6434)
Browse files Browse the repository at this point in the history
* Add binary conformance test for enum fields.

* Add failed conformance test to js failure list
  • Loading branch information
TeBoring committed Jul 23, 2019
1 parent 2c76c2c commit 455440f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conformance/binary_json_conformance_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,16 @@ void BinaryAndJsonConformanceSuite::RunSuiteImpl() {
{delim("\xfb"), "\"\xfb\""},
{delim(""), "\"\""},
});
TestValidDataForType(FieldDescriptor::TYPE_ENUM, {
{varint(0), "FOO"},
{varint(1), "BAR"},
{varint(2), "BAZ"},
{varint(-1), "NEG"},
});

// TODO(haberman):
// TestValidDataForType(FieldDescriptor::TYPE_GROUP
// TestValidDataForType(FieldDescriptor::TYPE_MESSAGE
// TestValidDataForType(FieldDescriptor::TYPE_ENUM

RunValidJsonTest("HelloWorld", REQUIRED,
"{\"optionalString\":\"Hello, World!\"}",
Expand Down
1 change: 1 addition & 0 deletions conformance/failure_list_js.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.ProtobufOutput

0 comments on commit 455440f

Please sign in to comment.