Add more JSON tests around underscores (#1963)

Add more JSON tests around underscores
pull/1967/head
Thomas Van Lenten 9 years ago committed by GitHub
parent 4763e64eb1
commit e389165586
  1. 7
      conformance/conformance.proto
  2. 38
      conformance/conformance_test.cc
  3. 3
      conformance/failure_list_java.txt
  4. 3
      conformance/failure_list_ruby.txt
  5. 247
      csharp/src/Google.Protobuf.Conformance/Conformance.cs

@ -253,6 +253,7 @@ message TestAllTypes {
repeated google.protobuf.Value repeated_value = 316; repeated google.protobuf.Value repeated_value = 316;
// Test field-name-to-JSON-name convention. // Test field-name-to-JSON-name convention.
// (protobuf says names can be any valid C/C++ identifier.)
int32 fieldname1 = 401; int32 fieldname1 = 401;
int32 field_name2 = 402; int32 field_name2 = 402;
int32 _field_name3 = 403; int32 _field_name3 = 403;
@ -265,6 +266,12 @@ message TestAllTypes {
int32 Field_Name10 = 410; int32 Field_Name10 = 410;
int32 FIELD_NAME11 = 411; int32 FIELD_NAME11 = 411;
int32 FIELD_name12 = 412; int32 FIELD_name12 = 412;
int32 __field_name13 = 413;
int32 __Field_name14 = 414;
int32 field__name15 = 415;
int32 field__Name16 = 416;
int32 field_name17__ = 417;
int32 Field_name18__ = 418;
} }
message ForeignMessage { message ForeignMessage {

@ -660,12 +660,14 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
R"({ R"({
"fieldname1": 1, "fieldname1": 1,
"fieldName2": 2, "fieldName2": 2,
"FieldName3": 3 "FieldName3": 3,
"FieldName4": 4
})", })",
R"( R"(
fieldname1: 1 fieldname1: 1
field_name2: 2 field_name2: 2
_field_name3: 3 _field_name3: 3
field__name4_: 4
)"); )");
RunValidJsonTest( RunValidJsonTest(
"FieldNameWithNumbers", "FieldNameWithNumbers",
@ -695,6 +697,24 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
FIELD_NAME11: 11 FIELD_NAME11: 11
FIELD_name12: 12 FIELD_name12: 12
)"); )");
RunValidJsonTest(
"FieldNameWithDoubleUnderscores",
R"({
"fieldName13": 13,
"fieldName14": 14,
"fieldName15": 15,
"fieldName16": 16,
"fieldName17": 17,
"fieldName18": 18
})",
R"(
__field_name13: 13
__Field_name14: 14
field__name15: 15
field__Name16: 16
field_name17__: 17
Field_name18__: 18
)");
// Using the original proto field name in JSON is also allowed. // Using the original proto field name in JSON is also allowed.
RunValidJsonTest( RunValidJsonTest(
"OriginalProtoFieldName", "OriginalProtoFieldName",
@ -702,6 +722,7 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
"fieldname1": 1, "fieldname1": 1,
"field_name2": 2, "field_name2": 2,
"_field_name3": 3, "_field_name3": 3,
"field__name4_": 4,
"field0name5": 5, "field0name5": 5,
"field_0_name6": 6, "field_0_name6": 6,
"fieldName7": 7, "fieldName7": 7,
@ -709,12 +730,19 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
"field_Name9": 9, "field_Name9": 9,
"Field_Name10": 10, "Field_Name10": 10,
"FIELD_NAME11": 11, "FIELD_NAME11": 11,
"FIELD_name12": 12 "FIELD_name12": 12,
"__field_name13": 13,
"__Field_name14": 14,
"field__name15": 15,
"field__Name16": 16,
"field_name17__": 17,
"Field_name18__": 18
})", })",
R"( R"(
fieldname1: 1 fieldname1: 1
field_name2: 2 field_name2: 2
_field_name3: 3 _field_name3: 3
field__name4_: 4
field0name5: 5 field0name5: 5
field_0_name6: 6 field_0_name6: 6
fieldName7: 7 fieldName7: 7
@ -723,6 +751,12 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
Field_Name10: 10 Field_Name10: 10
FIELD_NAME11: 11 FIELD_NAME11: 11
FIELD_name12: 12 FIELD_name12: 12
__field_name13: 13
__Field_name14: 14
field__name15: 15
field__Name16: 16
field_name17__: 17
Field_name18__: 18
)"); )");
// Field names can be escaped. // Field names can be escaped.
RunValidJsonTest( RunValidJsonTest(

@ -21,7 +21,10 @@ JsonInput.EnumFieldNotQuoted
JsonInput.FieldMaskInvalidCharacter JsonInput.FieldMaskInvalidCharacter
JsonInput.FieldNameDuplicate JsonInput.FieldNameDuplicate
JsonInput.FieldNameInSnakeCase.JsonOutput JsonInput.FieldNameInSnakeCase.JsonOutput
JsonInput.FieldNameInSnakeCase.ProtobufOutput
JsonInput.FieldNameNotQuoted JsonInput.FieldNameNotQuoted
JsonInput.FieldNameWithDoubleUnderscores.JsonOutput
JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput
JsonInput.FloatFieldInfinityNotQuoted JsonInput.FloatFieldInfinityNotQuoted
JsonInput.FloatFieldNanNotQuoted JsonInput.FloatFieldNanNotQuoted
JsonInput.FloatFieldNegativeInfinityNotQuoted JsonInput.FloatFieldNegativeInfinityNotQuoted

@ -59,6 +59,9 @@ JsonInput.EnumFieldUnknownValue.Validator
JsonInput.FieldMask.JsonOutput JsonInput.FieldMask.JsonOutput
JsonInput.FieldMask.ProtobufOutput JsonInput.FieldMask.ProtobufOutput
JsonInput.FieldNameInSnakeCase.JsonOutput JsonInput.FieldNameInSnakeCase.JsonOutput
JsonInput.FieldNameInSnakeCase.ProtobufOutput
JsonInput.FieldNameWithDoubleUnderscores.JsonOutput
JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput
JsonInput.FieldNameWithMixedCases.JsonOutput JsonInput.FieldNameWithMixedCases.JsonOutput
JsonInput.FieldNameWithMixedCases.ProtobufOutput JsonInput.FieldNameWithMixedCases.ProtobufOutput
JsonInput.FieldNameWithMixedCases.Validator JsonInput.FieldNameWithMixedCases.Validator

@ -34,7 +34,7 @@ namespace Conformance {
"IAEoCUgAEhkKD3NlcmlhbGl6ZV9lcnJvchgGIAEoCUgAEhcKDXJ1bnRpbWVf", "IAEoCUgAEhkKD3NlcmlhbGl6ZV9lcnJvchgGIAEoCUgAEhcKDXJ1bnRpbWVf",
"ZXJyb3IYAiABKAlIABIaChBwcm90b2J1Zl9wYXlsb2FkGAMgASgMSAASFgoM", "ZXJyb3IYAiABKAlIABIaChBwcm90b2J1Zl9wYXlsb2FkGAM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b3JlaWduTWVzc2FnZRIJCgFjGAEgASgFKjUKCldpcmVGb3JtYXQSDwoL",
"VU5TUEVDSUZJRUQQABIMCghQUk9UT0JVRhABEggKBEpTT04QAipACgtGb3Jl",
"aWduRW51bRIPCgtGT1JFSUdOX0ZPTxAAEg8KC0ZPUkVJR05fQkFSEAESDwoL",
"Rk9SRUlHTl9CQVoQAkIhCh9jb20uZ29vZ2xlLnByb3RvYnVmLmNvbmZvcm1h",
"bmNlYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), typeof(global::Conformance.ForeignEnum), }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), typeof(global::Conformance.ForeignEnum), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat" }, new[]{ "Payload" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "RequestedOutputFormat" }, new[]{ "Payload" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped" }, new[]{ "Result" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped" }, new[]{ "Result" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.TestAllTypes), global::Conformance.TestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12" }, new[]{ "OneofField" }, new[]{ typeof(global::Conformance.TestAllTypes.Types.NestedEnum) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.TestAllTypes.Types.NestedMessage), global::Conformance.TestAllTypes.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.TestAllTypes), global::Conformance.TestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::Conformance.TestAllTypes.Types.NestedEnum) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.TestAllTypes.Types.NestedMessage), global::Conformance.TestAllTypes.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null),
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ForeignMessage), global::Conformance.ForeignMessage.Parser, new[]{ "C" }, null, null, null) new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ForeignMessage), global::Conformance.ForeignMessage.Parser, new[]{ "C" }, null, null, null)
})); }));
@ -893,6 +897,12 @@ namespace Conformance {
fieldName10_ = other.fieldName10_; fieldName10_ = other.fieldName10_;
fIELDNAME11_ = other.fIELDNAME11_; fIELDNAME11_ = other.fIELDNAME11_;
fIELDName12_ = other.fIELDName12_; fIELDName12_ = other.fIELDName12_;
FieldName13_ = other.FieldName13_;
FieldName14_ = other.FieldName14_;
fieldName15_ = other.fieldName15_;
fieldName16_ = other.fieldName16_;
fieldName17_ = other.fieldName17_;
fieldName18_ = other.fieldName18_;
switch (other.OneofFieldCase) { switch (other.OneofFieldCase) {
case OneofFieldOneofCase.OneofUint32: case OneofFieldOneofCase.OneofUint32:
OneofUint32 = other.OneofUint32; OneofUint32 = other.OneofUint32;
@ -2012,6 +2022,7 @@ namespace Conformance {
private int fieldname1_; private int fieldname1_;
/// <summary> /// <summary>
/// Test field-name-to-JSON-name convention. /// Test field-name-to-JSON-name convention.
/// (protobuf says names can be any valid C/C++ identifier.)
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Fieldname1 { public int Fieldname1 {
@ -2142,6 +2153,72 @@ namespace Conformance {
} }
} }
/// <summary>Field number for the "__field_name13" field.</summary>
public const int FieldName13FieldNumber = 413;
private int FieldName13_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName13 {
get { return FieldName13_; }
set {
FieldName13_ = value;
}
}
/// <summary>Field number for the "__Field_name14" field.</summary>
public const int FieldName14FieldNumber = 414;
private int FieldName14_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName14 {
get { return FieldName14_; }
set {
FieldName14_ = value;
}
}
/// <summary>Field number for the "field__name15" field.</summary>
public const int FieldName15FieldNumber = 415;
private int fieldName15_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName15 {
get { return fieldName15_; }
set {
fieldName15_ = value;
}
}
/// <summary>Field number for the "field__Name16" field.</summary>
public const int FieldName16FieldNumber = 416;
private int fieldName16_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName16 {
get { return fieldName16_; }
set {
fieldName16_ = value;
}
}
/// <summary>Field number for the "field_name17__" field.</summary>
public const int FieldName17FieldNumber = 417;
private int fieldName17_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName17 {
get { return fieldName17_; }
set {
fieldName17_ = value;
}
}
/// <summary>Field number for the "Field_name18__" field.</summary>
public const int FieldName18FieldNumber = 418;
private int fieldName18_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FieldName18 {
get { return fieldName18_; }
set {
fieldName18_ = value;
}
}
private object oneofField_; private object oneofField_;
/// <summary>Enum of possible cases for the "oneof_field" oneof.</summary> /// <summary>Enum of possible cases for the "oneof_field" oneof.</summary>
public enum OneofFieldOneofCase { public enum OneofFieldOneofCase {
@ -2294,6 +2371,12 @@ namespace Conformance {
if (FieldName10 != other.FieldName10) return false; if (FieldName10 != other.FieldName10) return false;
if (FIELDNAME11 != other.FIELDNAME11) return false; if (FIELDNAME11 != other.FIELDNAME11) return false;
if (FIELDName12 != other.FIELDName12) return false; if (FIELDName12 != other.FIELDName12) return false;
if (FieldName13 != other.FieldName13) return false;
if (FieldName14 != other.FieldName14) return false;
if (FieldName15 != other.FieldName15) return false;
if (FieldName16 != other.FieldName16) return false;
if (FieldName17 != other.FieldName17) return false;
if (FieldName18 != other.FieldName18) return false;
if (OneofFieldCase != other.OneofFieldCase) return false; if (OneofFieldCase != other.OneofFieldCase) return false;
return true; return true;
} }
@ -2414,6 +2497,12 @@ namespace Conformance {
if (FieldName10 != 0) hash ^= FieldName10.GetHashCode(); if (FieldName10 != 0) hash ^= FieldName10.GetHashCode();
if (FIELDNAME11 != 0) hash ^= FIELDNAME11.GetHashCode(); if (FIELDNAME11 != 0) hash ^= FIELDNAME11.GetHashCode();
if (FIELDName12 != 0) hash ^= FIELDName12.GetHashCode(); if (FIELDName12 != 0) hash ^= FIELDName12.GetHashCode();
if (FieldName13 != 0) hash ^= FieldName13.GetHashCode();
if (FieldName14 != 0) hash ^= FieldName14.GetHashCode();
if (FieldName15 != 0) hash ^= FieldName15.GetHashCode();
if (FieldName16 != 0) hash ^= FieldName16.GetHashCode();
if (FieldName17 != 0) hash ^= FieldName17.GetHashCode();
if (FieldName18 != 0) hash ^= FieldName18.GetHashCode();
hash ^= (int) oneofFieldCase_; hash ^= (int) oneofFieldCase_;
return hash; return hash;
} }
@ -2703,6 +2792,30 @@ namespace Conformance {
output.WriteRawTag(224, 25); output.WriteRawTag(224, 25);
output.WriteInt32(FIELDName12); output.WriteInt32(FIELDName12);
} }
if (FieldName13 != 0) {
output.WriteRawTag(232, 25);
output.WriteInt32(FieldName13);
}
if (FieldName14 != 0) {
output.WriteRawTag(240, 25);
output.WriteInt32(FieldName14);
}
if (FieldName15 != 0) {
output.WriteRawTag(248, 25);
output.WriteInt32(FieldName15);
}
if (FieldName16 != 0) {
output.WriteRawTag(128, 26);
output.WriteInt32(FieldName16);
}
if (FieldName17 != 0) {
output.WriteRawTag(136, 26);
output.WriteInt32(FieldName17);
}
if (FieldName18 != 0) {
output.WriteRawTag(144, 26);
output.WriteInt32(FieldName18);
}
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2937,6 +3050,24 @@ namespace Conformance {
if (FIELDName12 != 0) { if (FIELDName12 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDName12); size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDName12);
} }
if (FieldName13 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName13);
}
if (FieldName14 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName14);
}
if (FieldName15 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName15);
}
if (FieldName16 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName16);
}
if (FieldName17 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName17);
}
if (FieldName18 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName18);
}
return size; return size;
} }
@ -3192,6 +3323,24 @@ namespace Conformance {
if (other.FIELDName12 != 0) { if (other.FIELDName12 != 0) {
FIELDName12 = other.FIELDName12; FIELDName12 = other.FIELDName12;
} }
if (other.FieldName13 != 0) {
FieldName13 = other.FieldName13;
}
if (other.FieldName14 != 0) {
FieldName14 = other.FieldName14;
}
if (other.FieldName15 != 0) {
FieldName15 = other.FieldName15;
}
if (other.FieldName16 != 0) {
FieldName16 = other.FieldName16;
}
if (other.FieldName17 != 0) {
FieldName17 = other.FieldName17;
}
if (other.FieldName18 != 0) {
FieldName18 = other.FieldName18;
}
switch (other.OneofFieldCase) { switch (other.OneofFieldCase) {
case OneofFieldOneofCase.OneofUint32: case OneofFieldOneofCase.OneofUint32:
OneofUint32 = other.OneofUint32; OneofUint32 = other.OneofUint32;
@ -3759,6 +3908,30 @@ namespace Conformance {
FIELDName12 = input.ReadInt32(); FIELDName12 = input.ReadInt32();
break; break;
} }
case 3304: {
FieldName13 = input.ReadInt32();
break;
}
case 3312: {
FieldName14 = input.ReadInt32();
break;
}
case 3320: {
FieldName15 = input.ReadInt32();
break;
}
case 3328: {
FieldName16 = input.ReadInt32();
break;
}
case 3336: {
FieldName17 = input.ReadInt32();
break;
}
case 3344: {
FieldName18 = input.ReadInt32();
break;
}
} }
} }
} }

Loading…
Cancel
Save