Unverified Commit d94255cb authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #10 from libp2p/fix/3

test: make sure we have the correct number of pools
parents c4a5988a 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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment