1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-05 09:47:56 -05:00
v2fly/transport/internet/header_test.go
Darien Raymond 6c9a60100d format code
2017-10-26 21:44:22 +02:00

28 lines
652 B
Go

package internet_test
import (
"testing"
. "v2ray.com/core/transport/internet"
"v2ray.com/core/transport/internet/headers/noop"
"v2ray.com/core/transport/internet/headers/srtp"
"v2ray.com/core/transport/internet/headers/utp"
. "v2ray.com/ext/assert"
)
func TestAllHeadersLoadable(t *testing.T) {
assert := With(t)
noopAuth, err := CreatePacketHeader((*noop.Config)(nil))
assert(err, IsNil)
assert(noopAuth.Size(), Equals, 0)
srtp, err := CreatePacketHeader((*srtp.Config)(nil))
assert(err, IsNil)
assert(srtp.Size(), Equals, 4)
utp, err := CreatePacketHeader((*utp.Config)(nil))
assert(err, IsNil)
assert(utp.Size(), Equals, 4)
}