1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 10:56:06 -05:00
v2fly/transport/internet/header_test.go

28 lines
652 B
Go
Raw Normal View History

2016-12-08 10:27:41 -05:00
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"
2017-10-26 15:44:22 -04:00
. "v2ray.com/ext/assert"
2016-12-08 10:27:41 -05:00
)
func TestAllHeadersLoadable(t *testing.T) {
2017-10-24 10:15:35 -04:00
assert := With(t)
2016-12-08 10:27:41 -05:00
2017-01-12 16:47:10 -05:00
noopAuth, err := CreatePacketHeader((*noop.Config)(nil))
2017-10-24 10:15:35 -04:00
assert(err, IsNil)
assert(noopAuth.Size(), Equals, 0)
2016-12-08 10:27:41 -05:00
2017-01-12 16:47:10 -05:00
srtp, err := CreatePacketHeader((*srtp.Config)(nil))
2017-10-24 10:15:35 -04:00
assert(err, IsNil)
assert(srtp.Size(), Equals, 4)
2016-12-08 10:27:41 -05:00
2017-01-12 16:47:10 -05:00
utp, err := CreatePacketHeader((*utp.Config)(nil))
2017-10-24 10:15:35 -04:00
assert(err, IsNil)
assert(utp.Size(), Equals, 4)
2016-12-08 10:27:41 -05:00
}