diff options
author | Jon Skeet <jonskeet@google.com> | 2015-06-25 13:45:53 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-06-25 13:45:53 +0100 |
commit | c06226354d89e53c96f69401539ef3208ba4ab44 (patch) | |
tree | d77fd3155f1da01e134c263eb5af5266b8ba5ef6 /csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs | |
parent | 3e7d70cb699e93a485ef11fce034f4767aac4b8f (diff) | |
download | protobuf-c06226354d89e53c96f69401539ef3208ba4ab44.tar.gz protobuf-c06226354d89e53c96f69401539ef3208ba4ab44.tar.bz2 protobuf-c06226354d89e53c96f69401539ef3208ba4ab44.zip |
Make map test keys even more different to avoid odd hash collisions
Diffstat (limited to 'csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs b/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs index 498e4718..75f8ff2a 100644 --- a/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs +++ b/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs @@ -177,12 +177,12 @@ namespace Google.Protobuf.Collections public void EqualityIsKeySensitive() { var map1 = new MapField<string, string>(); - map1.Add("a1", "v1"); - map1.Add("b1", "v2"); + map1.Add("first key", "v1"); + map1.Add("second key", "v2"); var map2 = new MapField<string, string>(); - map2.Add("a2", "v1"); - map2.Add("b2", "v2"); + map2.Add("third key", "v1"); + map2.Add("fourth key", "v2"); EqualityTester.AssertInequality(map1, map2); } @@ -193,12 +193,12 @@ namespace Google.Protobuf.Collections // Note: Without some care, it's a little easier than one might // hope to see hash collisions, but only in some environments... var map1 = new MapField<string, string>(); - map1.Add("a", "a1"); - map1.Add("b", "a2"); + map1.Add("a", "first value"); + map1.Add("b", "second value"); var map2 = new MapField<string, string>(); - map2.Add("a", "b1"); - map2.Add("b", "b2"); + map2.Add("a", "third value"); + map2.Add("b", "fourth value"); EqualityTester.AssertInequality(map1, map2); } |