diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2016-03-30 11:43:44 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2016-03-30 11:43:44 -0700 |
commit | 0de06f54bc8253ba39eee9e8cc4c5de487a48835 (patch) | |
tree | e66dec08e23df554f5c29a1dbb4592388815e4ec /conformance | |
parent | 3b3c8abb9635eb3ea078a821a99c9ef29d66dff7 (diff) | |
parent | a25e9964b126a79e8a99bced2207ddca22d6a1a9 (diff) |
Merge branch 'master' of github.com:google/protobuf
Diffstat (limited to 'conformance')
-rwxr-xr-x | conformance/conformance_ruby.rb | 16 | ||||
-rw-r--r-- | conformance/failure_list_ruby.txt | 144 |
2 files changed, 16 insertions, 144 deletions
diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index cd065673..c716facd 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -51,7 +51,12 @@ def do_test(request) end when :json_payload - test_message = Conformance::TestAllTypes.decode_json(request.json_payload) + begin + test_message = Conformance::TestAllTypes.decode_json(request.json_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') + return response + end when nil fail "Request didn't have payload" @@ -66,6 +71,9 @@ def do_test(request) when :JSON response.json_payload = test_message.to_json + + when nil + fail "Request didn't have requested output format" end rescue StandardError => err response.runtime_error = err.message.encode('utf-8') @@ -96,8 +104,8 @@ def do_test_io STDOUT.flush if $verbose - STDERR.puts("conformance-cpp: request={request.to_json}, " \ - "response={response.to_json}\n") + STDERR.puts("conformance_ruby: request=#{request.to_json}, " \ + "response=#{response.to_json}\n") end $test_count += 1 @@ -107,7 +115,7 @@ end loop do unless do_test_io - STDERR.puts('conformance-cpp: received EOF from test runner ' \ + STDERR.puts('conformance_ruby: received EOF from test runner ' \ "after #{$test_count} tests, exiting") break end diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index 1b2e7d94..ade0ff4c 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -1,18 +1,12 @@ -# Many of the JSON tests are failing due to a simple bug: -# fields are not camel-cased at all right now. Once this -# is fixed, this list should grow a lot shorter. - DurationProtoInputTooLarge.JsonOutput DurationProtoInputTooSmall.JsonOutput FieldMaskNumbersDontRoundTrip.JsonOutput FieldMaskPathsDontRoundTrip.JsonOutput FieldMaskTooManyUnderscore.JsonOutput -JsonInput.AllFieldAcceptNull.JsonOutput -JsonInput.AllFieldAcceptNull.ProtobufOutput JsonInput.Any.JsonOutput +JsonInput.Any.ProtobufOutput JsonInput.AnyNested.JsonOutput JsonInput.AnyNested.ProtobufOutput -JsonInput.Any.ProtobufOutput JsonInput.AnyUnorderedTypeTag.JsonOutput JsonInput.AnyUnorderedTypeTag.ProtobufOutput JsonInput.AnyWithDuration.JsonOutput @@ -29,31 +23,9 @@ JsonInput.AnyWithValueForInteger.JsonOutput JsonInput.AnyWithValueForInteger.ProtobufOutput JsonInput.AnyWithValueForJsonObject.JsonOutput JsonInput.AnyWithValueForJsonObject.ProtobufOutput -JsonInput.BoolFieldAllCapitalFalse -JsonInput.BoolFieldAllCapitalTrue -JsonInput.BoolFieldCamelCaseFalse -JsonInput.BoolFieldCamelCaseTrue -JsonInput.BoolFieldDoubleQuotedFalse -JsonInput.BoolFieldDoubleQuotedTrue -JsonInput.BoolFieldFalse.JsonOutput -JsonInput.BoolFieldFalse.ProtobufOutput JsonInput.BoolFieldIntegerOne JsonInput.BoolFieldIntegerZero -JsonInput.BoolFieldTrue.JsonOutput -JsonInput.BoolFieldTrue.ProtobufOutput -JsonInput.BoolMapEscapedKey.JsonOutput -JsonInput.BoolMapEscapedKey.ProtobufOutput -JsonInput.BoolMapField.JsonOutput -JsonInput.BoolMapFieldKeyNotQuoted -JsonInput.BoolMapField.ProtobufOutput -JsonInput.BytesFieldInvalidBase64Characters -JsonInput.BytesField.JsonOutput -JsonInput.BytesFieldNoPadding -JsonInput.BytesField.ProtobufOutput -JsonInput.BytesRepeatedField.JsonOutput -JsonInput.BytesRepeatedField.ProtobufOutput JsonInput.DoubleFieldInfinity.JsonOutput -JsonInput.DoubleFieldInfinityNotQuoted JsonInput.DoubleFieldInfinity.ProtobufOutput JsonInput.DoubleFieldMaxNegativeValue.JsonOutput JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput @@ -64,136 +36,74 @@ JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput JsonInput.DoubleFieldMinPositiveValue.JsonOutput JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput JsonInput.DoubleFieldNan.JsonOutput -JsonInput.DoubleFieldNanNotQuoted JsonInput.DoubleFieldNan.ProtobufOutput JsonInput.DoubleFieldNegativeInfinity.JsonOutput -JsonInput.DoubleFieldNegativeInfinityNotQuoted JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput JsonInput.DoubleFieldQuotedValue.JsonOutput JsonInput.DoubleFieldQuotedValue.ProtobufOutput -JsonInput.DoubleFieldTooLarge -JsonInput.DoubleFieldTooSmall JsonInput.DurationHas3FractionalDigits.Validator JsonInput.DurationHas6FractionalDigits.Validator JsonInput.DurationHas9FractionalDigits.Validator JsonInput.DurationHasZeroFractionalDigit.Validator -JsonInput.DurationJsonInputTooLarge -JsonInput.DurationJsonInputTooSmall JsonInput.DurationMaxValue.JsonOutput JsonInput.DurationMaxValue.ProtobufOutput JsonInput.DurationMinValue.JsonOutput JsonInput.DurationMinValue.ProtobufOutput -JsonInput.DurationMissingS JsonInput.DurationRepeatedValue.JsonOutput JsonInput.DurationRepeatedValue.ProtobufOutput -JsonInput.EnumField.JsonOutput -JsonInput.EnumFieldNotQuoted JsonInput.EnumFieldNumericValueNonZero.JsonOutput JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput JsonInput.EnumFieldNumericValueZero.JsonOutput JsonInput.EnumFieldNumericValueZero.ProtobufOutput -JsonInput.EnumField.ProtobufOutput JsonInput.EnumFieldUnknownValue.Validator -JsonInput.EnumRepeatedField.JsonOutput -JsonInput.EnumRepeatedField.ProtobufOutput -JsonInput.FieldMaskInvalidCharacter JsonInput.FieldMask.JsonOutput JsonInput.FieldMask.ProtobufOutput -JsonInput.FieldNameDuplicate -JsonInput.FieldNameDuplicateDifferentCasing1 -JsonInput.FieldNameDuplicateDifferentCasing2 -JsonInput.FieldNameEscaped.JsonOutput -JsonInput.FieldNameInLowerCamelCase.Validator JsonInput.FieldNameInSnakeCase.JsonOutput -JsonInput.FieldNameInSnakeCase.ProtobufOutput -JsonInput.FieldNameNotQuoted JsonInput.FieldNameWithMixedCases.JsonOutput JsonInput.FieldNameWithMixedCases.ProtobufOutput JsonInput.FieldNameWithMixedCases.Validator -JsonInput.FieldNameWithNumbers.JsonOutput -JsonInput.FieldNameWithNumbers.ProtobufOutput -JsonInput.FieldNameWithNumbers.Validator JsonInput.FloatFieldInfinity.JsonOutput -JsonInput.FloatFieldInfinityNotQuoted JsonInput.FloatFieldInfinity.ProtobufOutput -JsonInput.FloatFieldMaxNegativeValue.JsonOutput -JsonInput.FloatFieldMaxNegativeValue.ProtobufOutput -JsonInput.FloatFieldMaxPositiveValue.JsonOutput -JsonInput.FloatFieldMaxPositiveValue.ProtobufOutput -JsonInput.FloatFieldMinNegativeValue.JsonOutput -JsonInput.FloatFieldMinNegativeValue.ProtobufOutput -JsonInput.FloatFieldMinPositiveValue.JsonOutput -JsonInput.FloatFieldMinPositiveValue.ProtobufOutput JsonInput.FloatFieldNan.JsonOutput -JsonInput.FloatFieldNanNotQuoted JsonInput.FloatFieldNan.ProtobufOutput JsonInput.FloatFieldNegativeInfinity.JsonOutput -JsonInput.FloatFieldNegativeInfinityNotQuoted JsonInput.FloatFieldNegativeInfinity.ProtobufOutput JsonInput.FloatFieldQuotedValue.JsonOutput JsonInput.FloatFieldQuotedValue.ProtobufOutput JsonInput.FloatFieldTooLarge JsonInput.FloatFieldTooSmall -JsonInput.HelloWorld.JsonOutput -JsonInput.HelloWorld.ProtobufOutput JsonInput.Int32FieldExponentialFormat.JsonOutput JsonInput.Int32FieldExponentialFormat.ProtobufOutput JsonInput.Int32FieldFloatTrailingZero.JsonOutput JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput -JsonInput.Int32FieldLeadingSpace -JsonInput.Int32FieldLeadingZero JsonInput.Int32FieldMaxFloatValue.JsonOutput JsonInput.Int32FieldMaxFloatValue.ProtobufOutput -JsonInput.Int32FieldMaxValue.JsonOutput -JsonInput.Int32FieldMaxValue.ProtobufOutput JsonInput.Int32FieldMinFloatValue.JsonOutput JsonInput.Int32FieldMinFloatValue.ProtobufOutput JsonInput.Int32FieldMinValue.JsonOutput -JsonInput.Int32FieldMinValue.ProtobufOutput -JsonInput.Int32FieldNegativeWithLeadingZero -JsonInput.Int32FieldNotInteger -JsonInput.Int32FieldNotNumber -JsonInput.Int32FieldPlusSign -JsonInput.Int32FieldStringValueEscaped.JsonOutput -JsonInput.Int32FieldStringValueEscaped.ProtobufOutput JsonInput.Int32FieldStringValue.JsonOutput JsonInput.Int32FieldStringValue.ProtobufOutput -JsonInput.Int32FieldTooLarge -JsonInput.Int32FieldTooSmall -JsonInput.Int32FieldTrailingSpace +JsonInput.Int32FieldStringValueEscaped.JsonOutput +JsonInput.Int32FieldStringValueEscaped.ProtobufOutput JsonInput.Int32MapEscapedKey.JsonOutput JsonInput.Int32MapEscapedKey.ProtobufOutput JsonInput.Int32MapField.JsonOutput -JsonInput.Int32MapFieldKeyNotQuoted JsonInput.Int32MapField.ProtobufOutput JsonInput.Int64FieldBeString.Validator JsonInput.Int64FieldMaxValue.JsonOutput -JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput -JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput JsonInput.Int64FieldMaxValue.ProtobufOutput JsonInput.Int64FieldMinValue.JsonOutput -JsonInput.Int64FieldMinValueNotQuoted.JsonOutput -JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput JsonInput.Int64FieldMinValue.ProtobufOutput -JsonInput.Int64FieldNotInteger -JsonInput.Int64FieldNotNumber -JsonInput.Int64FieldTooLarge -JsonInput.Int64FieldTooSmall JsonInput.Int64MapEscapedKey.JsonOutput JsonInput.Int64MapEscapedKey.ProtobufOutput JsonInput.Int64MapField.JsonOutput -JsonInput.Int64MapFieldKeyNotQuoted JsonInput.Int64MapField.ProtobufOutput -JsonInput.JsonWithComments -JsonInput.MapFieldKeyIsNull -JsonInput.MapFieldValueIsNull JsonInput.MessageField.JsonOutput JsonInput.MessageField.ProtobufOutput JsonInput.MessageMapField.JsonOutput JsonInput.MessageMapField.ProtobufOutput JsonInput.MessageRepeatedField.JsonOutput JsonInput.MessageRepeatedField.ProtobufOutput -JsonInput.OneofFieldDuplicate JsonInput.OptionalBoolWrapper.JsonOutput JsonInput.OptionalBoolWrapper.ProtobufOutput JsonInput.OptionalBytesWrapper.JsonOutput @@ -215,6 +125,7 @@ JsonInput.OptionalUint64Wrapper.ProtobufOutput JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput JsonInput.OriginalProtoFieldName.JsonOutput +JsonInput.OriginalProtoFieldName.ProtobufOutput JsonInput.PrimitiveRepeatedField.JsonOutput JsonInput.PrimitiveRepeatedField.ProtobufOutput JsonInput.RepeatedBoolWrapper.JsonOutput @@ -223,18 +134,7 @@ JsonInput.RepeatedBytesWrapper.JsonOutput JsonInput.RepeatedBytesWrapper.ProtobufOutput JsonInput.RepeatedDoubleWrapper.JsonOutput JsonInput.RepeatedDoubleWrapper.ProtobufOutput -JsonInput.RepeatedFieldMessageElementIsNull -JsonInput.RepeatedFieldPrimitiveElementIsNull -JsonInput.RepeatedFieldTrailingComma -JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage -JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString -JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool -JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt -JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString -JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt -JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage JsonInput.RepeatedFloatWrapper.JsonOutput JsonInput.RepeatedFloatWrapper.ProtobufOutput JsonInput.RepeatedInt32Wrapper.JsonOutput @@ -247,39 +147,18 @@ JsonInput.RepeatedUint32Wrapper.JsonOutput JsonInput.RepeatedUint32Wrapper.ProtobufOutput JsonInput.RepeatedUint64Wrapper.JsonOutput JsonInput.RepeatedUint64Wrapper.ProtobufOutput -JsonInput.StringFieldEscape.JsonOutput -JsonInput.StringFieldEscape.ProtobufOutput -JsonInput.StringFieldInvalidEscape -JsonInput.StringField.JsonOutput JsonInput.StringFieldNotAString -JsonInput.StringField.ProtobufOutput JsonInput.StringFieldSurrogateInWrongOrder JsonInput.StringFieldSurrogatePair.JsonOutput JsonInput.StringFieldSurrogatePair.ProtobufOutput -JsonInput.StringFieldUnicodeEscape.JsonOutput -JsonInput.StringFieldUnicodeEscape.ProtobufOutput -JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput -JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput -JsonInput.StringFieldUnicode.JsonOutput -JsonInput.StringFieldUnicode.ProtobufOutput JsonInput.StringFieldUnpairedHighSurrogate JsonInput.StringFieldUnpairedLowSurrogate -JsonInput.StringFieldUnterminatedEscape -JsonInput.StringFieldUppercaseEscapeLetter -JsonInput.StringRepeatedField.JsonOutput -JsonInput.StringRepeatedField.ProtobufOutput JsonInput.Struct.JsonOutput JsonInput.Struct.ProtobufOutput JsonInput.TimestampHas3FractionalDigits.Validator JsonInput.TimestampHas6FractionalDigits.Validator JsonInput.TimestampHas9FractionalDigits.Validator JsonInput.TimestampHasZeroFractionalDigit.Validator -JsonInput.TimestampJsonInputLowercaseT -JsonInput.TimestampJsonInputLowercaseZ -JsonInput.TimestampJsonInputMissingT -JsonInput.TimestampJsonInputMissingZ -JsonInput.TimestampJsonInputTooLarge -JsonInput.TimestampJsonInputTooSmall JsonInput.TimestampMaxValue.JsonOutput JsonInput.TimestampMaxValue.ProtobufOutput JsonInput.TimestampMinValue.JsonOutput @@ -291,27 +170,14 @@ JsonInput.TimestampWithNegativeOffset.ProtobufOutput JsonInput.TimestampWithPositiveOffset.JsonOutput JsonInput.TimestampWithPositiveOffset.ProtobufOutput JsonInput.TimestampZeroNormalized.Validator -JsonInput.TrailingCommaInAnObject JsonInput.Uint32FieldMaxFloatValue.JsonOutput JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput -JsonInput.Uint32FieldMaxValue.JsonOutput -JsonInput.Uint32FieldMaxValue.ProtobufOutput -JsonInput.Uint32FieldNotInteger -JsonInput.Uint32FieldNotNumber -JsonInput.Uint32FieldTooLarge JsonInput.Uint32MapField.JsonOutput -JsonInput.Uint32MapFieldKeyNotQuoted JsonInput.Uint32MapField.ProtobufOutput JsonInput.Uint64FieldBeString.Validator JsonInput.Uint64FieldMaxValue.JsonOutput -JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput -JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput JsonInput.Uint64FieldMaxValue.ProtobufOutput -JsonInput.Uint64FieldNotInteger -JsonInput.Uint64FieldNotNumber -JsonInput.Uint64FieldTooLarge JsonInput.Uint64MapField.JsonOutput -JsonInput.Uint64MapFieldKeyNotQuoted JsonInput.Uint64MapField.ProtobufOutput JsonInput.ValueAcceptBool.JsonOutput JsonInput.ValueAcceptBool.ProtobufOutput @@ -327,8 +193,6 @@ JsonInput.ValueAcceptObject.JsonOutput JsonInput.ValueAcceptObject.ProtobufOutput JsonInput.ValueAcceptString.JsonOutput JsonInput.ValueAcceptString.ProtobufOutput -JsonInput.WrapperTypesWithNullValue.JsonOutput -JsonInput.WrapperTypesWithNullValue.ProtobufOutput ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput |