1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-08-30 16:24:37 -04:00
v2fly/transport/internet/headers/srtp/srtp_test.go
2016-12-09 11:35:27 +01:00

23 lines
447 B
Go

package srtp_test
import (
"testing"
"v2ray.com/core/common/buf"
"v2ray.com/core/testing/assert"
. "v2ray.com/core/transport/internet/headers/srtp"
)
func TestSRTPWrite(t *testing.T) {
assert := assert.On(t)
content := []byte{'a', 'b', 'c', 'd', 'e', 'f', 'g'}
srtp := SRTP{}
payload := buf.NewLocalBuffer(2048)
payload.AppendFunc(srtp.Write)
payload.Append(content)
assert.Int(payload.Len()).Equals(len(content) + srtp.Size())
}