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.
28 lines
673 B
28 lines
673 B
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, int32(0))
|
|
|
|
srtp, err := CreatePacketHeader((*srtp.Config)(nil))
|
|
assert(err, IsNil)
|
|
assert(srtp.Size(), Equals, int32(4))
|
|
|
|
utp, err := CreatePacketHeader((*utp.Config)(nil))
|
|
assert(err, IsNil)
|
|
assert(utp.Size(), Equals, int32(4))
|
|
}
|