1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-27 22:36:12 -04:00

more test case for buffer

This commit is contained in:
v2ray 2016-07-28 16:29:38 +02:00
parent 42efa5dde0
commit 7385c05f29
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -20,3 +20,20 @@ func TestBuffer(t *testing.T) {
assert.Pointer(b.Allocate()).IsNil()
b.Release()
}
func TestSingleRelease(t *testing.T) {
assert := assert.On(t)
b := NewBuffer()
x := b.Allocate()
x.Release()
y := b.Allocate()
assert.Pointer(y.Value).IsNotNil()
b.Release()
y.Release()
z := b.Allocate()
assert.Pointer(z).IsNil()
}