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
fc648bc8
Commit
fc648bc8
authored
Jun 19, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: make sure we have the correct number of pools
fixes #3
parent
c4a5988a
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 @
fc648bc8
...
...
@@ -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