Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
c0622635
Commit
c0622635
authored
Jun 25, 2015
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make map test keys even more different to avoid odd hash collisions
parent
3e7d70cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
MapFieldTest.cs
csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs
+8
-8
No files found.
csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs
View file @
c0622635
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment