mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
375 B
23 lines
375 B
8 years ago
|
package kcp_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/v2ray/v2ray-core/testing/assert"
|
||
|
. "github.com/v2ray/v2ray-core/transport/internet/kcp"
|
||
|
)
|
||
|
|
||
|
func TestBuffer(t *testing.T) {
|
||
|
assert := assert.On(t)
|
||
|
|
||
|
b := NewBuffer()
|
||
|
|
||
|
for i := 0; i < NumDistro; i++ {
|
||
|
x := b.Allocate()
|
||
|
assert.Pointer(x).IsNotNil()
|
||
|
x.Release()
|
||
|
}
|
||
|
assert.Pointer(b.Allocate()).IsNil()
|
||
|
b.Release()
|
||
|
}
|