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
p2p
go-buffer-pool
Commits
d94255cb
Unverified
Commit
d94255cb
authored
Jun 19, 2019
by
Steven Allen
Committed by
GitHub
Jun 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10 from libp2p/fix/3
test: make sure we have the correct number of pools
parents
c4a5988a
fc648bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
pool_test.go
pool_test.go
+11
-0
No files found.
pool_test.go
View file @
d94255cb
...
...
@@ -32,6 +32,17 @@ func TestAllocations(t *testing.T) {
}
}
func
TestRange
(
t
*
testing
.
T
)
{
min
:=
nextLogBase2
(
1
)
max
:=
nextLogBase2
(
uint32
(
MaxLength
))
if
int
(
max
)
!=
len
(
GlobalPool
.
pools
)
-
1
{
t
.
Errorf
(
"expected %d pools, found %d"
,
max
,
len
(
GlobalPool
.
pools
))
}
if
min
!=
0
{
t
.
Errorf
(
"unused min pool"
)
}
}
func
TestPool
(
t
*
testing
.
T
)
{
// disable GC so we can control when it happens.
defer
debug
.
SetGCPercent
(
debug
.
SetGCPercent
(
-
1
))
...
...
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