Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-ld-prime
Commits
80febfe2
Commit
80febfe2
authored
Feb 27, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sanity check on visit count to traversal bench
parent
61ebf6e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tests/traversalBenchmarks.go
tests/traversalBenchmarks.go
+7
-1
No files found.
tests/traversalBenchmarks.go
View file @
80febfe2
...
...
@@ -27,9 +27,15 @@ func SpecBenchmarkWalkMapStrInt_3n(b *testing.B, nb ipld.NodeBuilder) {
panic
(
err
)
}
b
.
ResetTimer
()
var
visitCountSanityCheck
int
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
visitCountSanityCheck
=
0
traversal
.
WalkMatching
(
n
,
sel
,
func
(
tp
traversal
.
Progress
,
n
ipld
.
Node
)
error
{
return
nil
// no need to do anything here; just care about exercising the walk internals.
visitCountSanityCheck
++
// this sanity check is sufficiently cheap to be worth it
return
nil
// no need to do anything here; just care about exercising the walk internals.
})
}
if
visitCountSanityCheck
!=
3
{
b
.
Fatalf
(
"visitCountSanityCheck should be 3, got %d"
,
visitCountSanityCheck
)
}
}
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