diff options
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs index d3aaa01b..9b82db27 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs @@ -233,6 +233,7 @@ namespace ProtobufTestMessages.Proto3 { /// </summary> public sealed partial class TestAllTypesProto3 : pb::IMessage<TestAllTypesProto3> { private static readonly pb::MessageParser<TestAllTypesProto3> _parser = new pb::MessageParser<TestAllTypesProto3>(() => new TestAllTypesProto3()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<TestAllTypesProto3> Parser { get { return _parser; } } @@ -395,6 +396,7 @@ namespace ProtobufTestMessages.Proto3 { break; } + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1840,7 +1842,7 @@ namespace ProtobufTestMessages.Proto3 { if (FieldName17 != other.FieldName17) return false; if (FieldName18 != other.FieldName18) return false; if (OneofFieldCase != other.OneofFieldCase) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1966,6 +1968,9 @@ namespace ProtobufTestMessages.Proto3 { if (FieldName17 != 0) hash ^= FieldName17.GetHashCode(); if (FieldName18 != 0) hash ^= FieldName18.GetHashCode(); hash ^= (int) oneofFieldCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -2278,6 +2283,9 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(144, 26); output.WriteInt32(FieldName18); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2530,6 +2538,9 @@ namespace ProtobufTestMessages.Proto3 { if (FieldName18 != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName18); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -2836,6 +2847,7 @@ namespace ProtobufTestMessages.Proto3 { break; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2844,7 +2856,7 @@ namespace ProtobufTestMessages.Proto3 { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { OptionalInt32 = input.ReadInt32(); @@ -3417,6 +3429,7 @@ namespace ProtobufTestMessages.Proto3 { public sealed partial class NestedMessage : pb::IMessage<NestedMessage> { private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } } @@ -3441,6 +3454,7 @@ namespace ProtobufTestMessages.Proto3 { public NestedMessage(NestedMessage other) : this() { a_ = other.a_; Corecursive = other.corecursive_ != null ? other.Corecursive.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3485,7 +3499,7 @@ namespace ProtobufTestMessages.Proto3 { } if (A != other.A) return false; if (!object.Equals(Corecursive, other.Corecursive)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3493,6 +3507,9 @@ namespace ProtobufTestMessages.Proto3 { int hash = 1; if (A != 0) hash ^= A.GetHashCode(); if (corecursive_ != null) hash ^= Corecursive.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3511,6 +3528,9 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(18); output.WriteMessage(Corecursive); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3522,6 +3542,9 @@ namespace ProtobufTestMessages.Proto3 { if (corecursive_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Corecursive); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -3539,6 +3562,7 @@ namespace ProtobufTestMessages.Proto3 { } Corecursive.MergeFrom(other.Corecursive); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3547,7 +3571,7 @@ namespace ProtobufTestMessages.Proto3 { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { A = input.ReadInt32(); @@ -3573,6 +3597,7 @@ namespace ProtobufTestMessages.Proto3 { public sealed partial class ForeignMessage : pb::IMessage<ForeignMessage> { private static readonly pb::MessageParser<ForeignMessage> _parser = new pb::MessageParser<ForeignMessage>(() => new ForeignMessage()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<ForeignMessage> Parser { get { return _parser; } } @@ -3596,6 +3621,7 @@ namespace ProtobufTestMessages.Proto3 { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3628,13 +3654,16 @@ namespace ProtobufTestMessages.Proto3 { return true; } if (C != other.C) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (C != 0) hash ^= C.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -3649,6 +3678,9 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(8); output.WriteInt32(C); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3657,6 +3689,9 @@ namespace ProtobufTestMessages.Proto3 { if (C != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(C); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -3668,6 +3703,7 @@ namespace ProtobufTestMessages.Proto3 { if (other.C != 0) { C = other.C; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3676,7 +3712,7 @@ namespace ProtobufTestMessages.Proto3 { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { C = input.ReadInt32(); |