aboutsummaryrefslogtreecommitdiffhomepage
path: root/conformance
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2016-01-05 16:31:40 -0500
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-01-05 16:31:40 -0500
commitdf4e4d8717987232499b9be50b24adac179528b3 (patch)
treec1b93f94c828a4ffe93a6118a354bc0ad815d1f2 /conformance
parentd19c26f2c878883f103d9dd4d6c53bc20482756f (diff)
Fix up the conformance tests
- Update all the new runner cases to handle a skip result as a skip and not a failure. - Make ObjC use the new serialize_error result if it fails to generate the data.
Diffstat (limited to 'conformance')
-rw-r--r--conformance/conformance_objc.m2
-rw-r--r--conformance/conformance_test.cc11
-rw-r--r--conformance/failure_list_objc.txt111
3 files changed, 16 insertions, 108 deletions
diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m
index 06c97a82..1124bfeb 100644
--- a/conformance/conformance_objc.m
+++ b/conformance/conformance_objc.m
@@ -95,7 +95,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
case WireFormat_Protobuf:
response.protobufPayload = testMessage.data;
if (!response.protobufPayload) {
- response.runtimeError =
+ response.serializeError =
[NSString stringWithFormat:@"Failed to make data from: %@", testMessage];
}
break;
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc
index c39bf26d..a232ecc5 100644
--- a/conformance/conformance_test.cc
+++ b/conformance/conformance_test.cc
@@ -356,6 +356,8 @@ void ConformanceTestSuite::ExpectParseFailureForProto(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't.");
@@ -408,6 +410,11 @@ void ConformanceTestSuite::RunValidJsonTestWithValidator(
RunTest(effective_test_name, request, &response);
+ if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
+ return;
+ }
+
if (response.result_case() != ConformanceResponse::kJsonPayload) {
ReportFailure(effective_test_name, request, response,
"Expected JSON payload but got type %d.",
@@ -444,6 +451,8 @@ void ConformanceTestSuite::ExpectParseFailureForJson(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't.");
@@ -466,6 +475,8 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson(
RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kSerializeError) {
ReportSuccess(effective_test_name);
+ } else if (response.result_case() == ConformanceResponse::kSkipped) {
+ ReportSkip(effective_test_name, request, response);
} else {
ReportFailure(effective_test_name, request, response,
"Should have failed to serialize, but didn't.");
diff --git a/conformance/failure_list_objc.txt b/conformance/failure_list_objc.txt
index b13de084..5dac3501 100644
--- a/conformance/failure_list_objc.txt
+++ b/conformance/failure_list_objc.txt
@@ -1,107 +1,4 @@
-# TODO(xiaofeng): These tests should be skipped (because objc doesn't support
-# JSON) but currently they are reported as failures by the objc testee.
-DurationProtoInputTooLarge.JsonOutput
-DurationProtoInputTooSmall.JsonOutput
-FieldMaskNumbersDontRoundTrip.JsonOutput
-FieldMaskPathsDontRoundTrip.JsonOutput
-FieldMaskTooManyUnderscore.JsonOutput
-JsonInput.BoolFieldAllCapitalFalse
-JsonInput.BoolFieldAllCapitalTrue
-JsonInput.BoolFieldCamelCaseFalse
-JsonInput.BoolFieldCamelCaseTrue
-JsonInput.BoolFieldDoubleQuotedFalse
-JsonInput.BoolFieldDoubleQuotedTrue
-JsonInput.BoolFieldIntegerOne
-JsonInput.BoolFieldIntegerZero
-JsonInput.BoolMapFieldKeyNotQuoted
-JsonInput.BytesFieldInvalidBase64Characters
-JsonInput.BytesFieldNoPadding
-JsonInput.DoubleFieldInfinityNotQuoted
-JsonInput.DoubleFieldNanNotQuoted
-JsonInput.DoubleFieldNegativeInfinityNotQuoted
-JsonInput.DoubleFieldTooLarge
-JsonInput.DoubleFieldTooSmall
-JsonInput.DurationHas3FractionalDigits.Validator
-JsonInput.DurationHas6FractionalDigits.Validator
-JsonInput.DurationHas9FractionalDigits.Validator
-JsonInput.DurationHasZeroFractionalDigit.Validator
-JsonInput.DurationJsonInputTooLarge
-JsonInput.DurationJsonInputTooSmall
-JsonInput.DurationMissingS
-JsonInput.EnumFieldNotQuoted
-JsonInput.EnumFieldUnknownValue.Validator
-JsonInput.FieldMaskInvalidCharacter
-JsonInput.FieldNameDuplicate
-JsonInput.FieldNameDuplicateDifferentCasing1
-JsonInput.FieldNameDuplicateDifferentCasing2
-JsonInput.FieldNameInLowerCamelCase.Validator
-JsonInput.FieldNameNotQuoted
-JsonInput.FieldNameWithMixedCases.Validator
-JsonInput.FieldNameWithNumbers.Validator
-JsonInput.FloatFieldInfinityNotQuoted
-JsonInput.FloatFieldNanNotQuoted
-JsonInput.FloatFieldNegativeInfinityNotQuoted
-JsonInput.FloatFieldTooLarge
-JsonInput.FloatFieldTooSmall
-JsonInput.Int32FieldLeadingSpace
-JsonInput.Int32FieldLeadingZero
-JsonInput.Int32FieldNegativeWithLeadingZero
-JsonInput.Int32FieldNotInteger
-JsonInput.Int32FieldNotNumber
-JsonInput.Int32FieldPlusSign
-JsonInput.Int32FieldTooLarge
-JsonInput.Int32FieldTooSmall
-JsonInput.Int32FieldTrailingSpace
-JsonInput.Int32MapFieldKeyNotQuoted
-JsonInput.Int64FieldBeString.Validator
-JsonInput.Int64FieldNotInteger
-JsonInput.Int64FieldNotNumber
-JsonInput.Int64FieldTooLarge
-JsonInput.Int64FieldTooSmall
-JsonInput.Int64MapFieldKeyNotQuoted
-JsonInput.JsonWithComments
-JsonInput.MapFieldKeyIsNull
-JsonInput.MapFieldValueIsNull
-JsonInput.OneofFieldDuplicate
-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.StringFieldInvalidEscape
-JsonInput.StringFieldNotAString
-JsonInput.StringFieldSurrogateInWrongOrder
-JsonInput.StringFieldUnpairedHighSurrogate
-JsonInput.StringFieldUnpairedLowSurrogate
-JsonInput.StringFieldUnterminatedEscape
-JsonInput.StringFieldUppercaseEscapeLetter
-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.TimestampZeroNormalized.Validator
-JsonInput.TrailingCommaInAnObject
-JsonInput.Uint32FieldNotInteger
-JsonInput.Uint32FieldNotNumber
-JsonInput.Uint32FieldTooLarge
-JsonInput.Uint32MapFieldKeyNotQuoted
-JsonInput.Uint64FieldBeString.Validator
-JsonInput.Uint64FieldNotInteger
-JsonInput.Uint64FieldNotNumber
-JsonInput.Uint64FieldTooLarge
-JsonInput.Uint64MapFieldKeyNotQuoted
-TimestampProtoInputTooLarge.JsonOutput
-TimestampProtoInputTooSmall.JsonOutput
+# No tests currently failing.
+#
+# json input or output tests are skipped (in conformance_objc.m) as mobile
+# platforms don't support json wire format to avoid code bloat.