diff options
author | Jie Luo <jieluo@google.com> | 2017-12-19 11:54:11 -0800 |
---|---|---|
committer | Jie Luo <jieluo@google.com> | 2017-12-19 15:38:02 -0800 |
commit | b308580bb1c3f87a062ac1448a3e0bdaab9d40cf (patch) | |
tree | ea211f27b3deb05a9ba5461079288020a11b5c8d /csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs | |
parent | 3a06fe1fc9590b534f403114a0668befba926947 (diff) | |
download | protobuf-b308580bb1c3f87a062ac1448a3e0bdaab9d40cf.tar.gz protobuf-b308580bb1c3f87a062ac1448a3e0bdaab9d40cf.tar.bz2 protobuf-b308580bb1c3f87a062ac1448a3e0bdaab9d40cf.zip |
Cherrypick for csharp, including:
Add preserve UnknownFields
Compare floating point values bitwise
Add auto-generated header to C# generated files
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index f6df4e87..6bf97151 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/protobuf/unittest_import_proto3.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: unittest_import_proto3.proto +// </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -9,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { - /// <summary>Holder for reflection information generated from google/protobuf/unittest_import_proto3.proto</summary> + /// <summary>Holder for reflection information generated from unittest_import_proto3.proto</summary> public static partial class UnittestImportProto3Reflection { #region Descriptor - /// <summary>File descriptor for google/protobuf/unittest_import_proto3.proto</summary> + /// <summary>File descriptor for unittest_import_proto3.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -22,14 +24,12 @@ namespace Google.Protobuf.TestProtos { static UnittestImportProto3Reflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90", - "bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0GjNnb29nbGUvcHJvdG9idWYv", - "dW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90bzMucHJvdG8iGgoNSW1wb3J0", - "TWVzc2FnZRIJCgFkGAEgASgFKlkKCkltcG9ydEVudW0SGwoXSU1QT1JUX0VO", - "VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB", - "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", - "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", - "Mw==")); + "Chx1bml0dGVzdF9pbXBvcnRfcHJvdG8zLnByb3RvEhhwcm90b2J1Zl91bml0", + "dGVzdF9pbXBvcnQaI3VuaXR0ZXN0X2ltcG9ydF9wdWJsaWNfcHJvdG8zLnBy", + "b3RvIhoKDUltcG9ydE1lc3NhZ2USCQoBZBgBIAEoBSpZCgpJbXBvcnRFbnVt", + "EhsKF0lNUE9SVF9FTlVNX1VOU1BFQ0lGSUVEEAASDgoKSU1QT1JUX0ZPTxAH", + "Eg4KCklNUE9SVF9CQVIQCBIOCgpJTVBPUlRfQkFaEAlCHaoCGkdvb2dsZS5Q", + "cm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3Reflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ImportEnum), }, new pbr::GeneratedClrTypeInfo[] { @@ -52,6 +52,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; } } @@ -75,6 +76,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] @@ -107,13 +109,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; } @@ -128,6 +133,9 @@ namespace Google.Protobuf.TestProtos { output.WriteRawTag(8); output.WriteInt32(D); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -136,6 +144,9 @@ namespace Google.Protobuf.TestProtos { if (D != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(D); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -147,6 +158,7 @@ namespace Google.Protobuf.TestProtos { if (other.D != 0) { D = other.D; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -155,7 +167,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(); |