aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
diff options
context:
space:
mode:
authorGravatar Jie Luo <anandolee@gmail.com>2017-12-13 13:48:58 -0800
committerGravatar GitHub <noreply@github.com>2017-12-13 13:48:58 -0800
commitbfd254e14f60f77f68f4de8524cd8984191206d5 (patch)
treeb47be82d057f3234aa055f4da2f607a102cc5077 /csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
parent0a7120ac32e16d49a35abf18186c8c4db515dd02 (diff)
Add unknown field support for csharp (#3936)
Add unknown field support for csharp
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs')
-rw-r--r--csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
index 1ebf007f..dfd09683 100644
--- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
+++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
@@ -50,6 +50,7 @@ namespace Google.Protobuf.TestProtos {
#region Messages
public sealed partial class ImportMessage : pb::IMessage<ImportMessage> {
private static readonly pb::MessageParser<ImportMessage> _parser = new pb::MessageParser<ImportMessage>(() => new ImportMessage());
+ private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ImportMessage> Parser { get { return _parser; } }
@@ -73,6 +74,7 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ImportMessage(ImportMessage other) : this() {
d_ = other.d_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -105,13 +107,16 @@ namespace Google.Protobuf.TestProtos {
return true;
}
if (D != other.D) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (D != 0) hash ^= D.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
@@ -126,6 +131,9 @@ namespace Google.Protobuf.TestProtos {
output.WriteRawTag(8);
output.WriteInt32(D);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -134,6 +142,9 @@ namespace Google.Protobuf.TestProtos {
if (D != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(D);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
@@ -145,6 +156,7 @@ namespace Google.Protobuf.TestProtos {
if (other.D != 0) {
D = other.D;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -153,7 +165,7 @@ namespace Google.Protobuf.TestProtos {
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
D = input.ReadInt32();