Merge pull request #1094 from thomasvl/update_objc_conformance

Fix up the conformance tests
pull/1101/head
Thomas Van Lenten 9 years ago
commit ee4a0c0e06
  1. 2
      conformance/conformance_objc.m
  2. 11
      conformance/conformance_test.cc
  3. 111
      conformance/failure_list_objc.txt

@ -95,7 +95,7 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) {
case WireFormat_Protobuf: case WireFormat_Protobuf:
response.protobufPayload = testMessage.data; response.protobufPayload = testMessage.data;
if (!response.protobufPayload) { if (!response.protobufPayload) {
response.runtimeError = response.serializeError =
[NSString stringWithFormat:@"Failed to make data from: %@", testMessage]; [NSString stringWithFormat:@"Failed to make data from: %@", testMessage];
} }
break; break;

@ -356,6 +356,8 @@ void ConformanceTestSuite::ExpectParseFailureForProto(
RunTest(effective_test_name, request, &response); RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) { if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name); ReportSuccess(effective_test_name);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
ReportSkip(effective_test_name, request, response);
} else { } else {
ReportFailure(effective_test_name, request, response, ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't."); "Should have failed to parse, but didn't.");
@ -408,6 +410,11 @@ void ConformanceTestSuite::RunValidJsonTestWithValidator(
RunTest(effective_test_name, request, &response); 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) { if (response.result_case() != ConformanceResponse::kJsonPayload) {
ReportFailure(effective_test_name, request, response, ReportFailure(effective_test_name, request, response,
"Expected JSON payload but got type %d.", "Expected JSON payload but got type %d.",
@ -444,6 +451,8 @@ void ConformanceTestSuite::ExpectParseFailureForJson(
RunTest(effective_test_name, request, &response); RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kParseError) { if (response.result_case() == ConformanceResponse::kParseError) {
ReportSuccess(effective_test_name); ReportSuccess(effective_test_name);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
ReportSkip(effective_test_name, request, response);
} else { } else {
ReportFailure(effective_test_name, request, response, ReportFailure(effective_test_name, request, response,
"Should have failed to parse, but didn't."); "Should have failed to parse, but didn't.");
@ -466,6 +475,8 @@ void ConformanceTestSuite::ExpectSerializeFailureForJson(
RunTest(effective_test_name, request, &response); RunTest(effective_test_name, request, &response);
if (response.result_case() == ConformanceResponse::kSerializeError) { if (response.result_case() == ConformanceResponse::kSerializeError) {
ReportSuccess(effective_test_name); ReportSuccess(effective_test_name);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
ReportSkip(effective_test_name, request, response);
} else { } else {
ReportFailure(effective_test_name, request, response, ReportFailure(effective_test_name, request, response,
"Should have failed to serialize, but didn't."); "Should have failed to serialize, but didn't.");

@ -1,107 +1,4 @@
# TODO(xiaofeng): These tests should be skipped (because objc doesn't support # No tests currently failing.
# JSON) but currently they are reported as failures by the objc testee. #
DurationProtoInputTooLarge.JsonOutput # json input or output tests are skipped (in conformance_objc.m) as mobile
DurationProtoInputTooSmall.JsonOutput # platforms don't support json wire format to avoid code bloat.
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

Loading…
Cancel
Save