mirror of
https://github.com/fumiama/orbyte.git
synced 2026-06-11 05:30:29 +08:00
init
This commit is contained in:
21
pbuf/pbuf_test.go
Normal file
21
pbuf/pbuf_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package pbuf
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBytes(t *testing.T) {
|
||||
for i := 0; i < 4096; i++ {
|
||||
b := NewBytes(i)
|
||||
rand.Read(b.Bytes())
|
||||
b.Destroy()
|
||||
}
|
||||
runtime.GC()
|
||||
out, in := bufferPool.p.CountItems()
|
||||
t.Log(out, in)
|
||||
if out != 0 || in != 1 {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user