From 55313c9c5d7917d58428d84d193ae3772e4684f8 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Sat, 24 Oct 2015 06:46:02 +0100 Subject: Generated code for previous commit (oneof case contributing to hash code and equality). --- csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs | 4 ++++ csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs | 4 ++++ csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs | 2 ++ 3 files changed, 10 insertions(+) (limited to 'csharp/src/Google.Protobuf.Test') diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index addec057..38cd5718 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -1260,6 +1260,8 @@ namespace UnitTest.Issues.TestProtos { if (PlainString != other.PlainString) return false; if (O2Int32 != other.O2Int32) return false; if (O2String != other.O2String) return false; + if (O1Case != other.O1Case) return false; + if (O2Case != other.O2Case) return false; return true; } @@ -1271,6 +1273,8 @@ namespace UnitTest.Issues.TestProtos { if (PlainString.Length != 0) hash ^= PlainString.GetHashCode(); if (o2Case_ == O2OneofCase.O2Int32) hash ^= O2Int32.GetHashCode(); if (o2Case_ == O2OneofCase.O2String) hash ^= O2String.GetHashCode(); + hash ^= (int) o1Case_; + hash ^= (int) o2Case_; return hash; } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index 0c7b5279..cecc2d11 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -868,6 +868,7 @@ namespace Google.Protobuf.TestProtos { if (!object.Equals(OneofNestedMessage, other.OneofNestedMessage)) return false; if (OneofString != other.OneofString) return false; if (OneofBytes != other.OneofBytes) return false; + if (OneofFieldCase != other.OneofFieldCase) return false; return true; } @@ -921,6 +922,7 @@ namespace Google.Protobuf.TestProtos { if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) hash ^= OneofString.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) hash ^= OneofBytes.GetHashCode(); + hash ^= (int) oneofFieldCase_; return hash; } @@ -4470,6 +4472,7 @@ namespace Google.Protobuf.TestProtos { if (FooInt != other.FooInt) return false; if (FooString != other.FooString) return false; if (!object.Equals(FooMessage, other.FooMessage)) return false; + if (FooCase != other.FooCase) return false; return true; } @@ -4478,6 +4481,7 @@ namespace Google.Protobuf.TestProtos { if (fooCase_ == FooOneofCase.FooInt) hash ^= FooInt.GetHashCode(); if (fooCase_ == FooOneofCase.FooString) hash ^= FooString.GetHashCode(); if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); + hash ^= (int) fooCase_; return hash; } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index bd90ddd8..d47b97f9 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -1596,6 +1596,7 @@ namespace Google.Protobuf.TestProtos { if (BoolField != other.BoolField) return false; if (StringField != other.StringField) return false; if (BytesField != other.BytesField) return false; + if (OneofFieldCase != other.OneofFieldCase) return false; return true; } @@ -1619,6 +1620,7 @@ namespace Google.Protobuf.TestProtos { if (oneofFieldCase_ == OneofFieldOneofCase.BoolField) hash ^= BoolField.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.StringField) hash ^= StringField.GetHashCode(); if (oneofFieldCase_ == OneofFieldOneofCase.BytesField) hash ^= BytesField.GetHashCode(); + hash ^= (int) oneofFieldCase_; return hash; } -- cgit v1.2.3