1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-31 00:08:08 -04:00
v2fly/transport/internet/authenticator_test.go

29 lines
822 B
Go
Raw Normal View History

2016-08-08 16:47:59 -04:00
package internet_test
import (
"testing"
2016-10-17 08:35:13 -04:00
"v2ray.com/core/common/loader"
2016-08-20 14:55:45 -04:00
"v2ray.com/core/testing/assert"
. "v2ray.com/core/transport/internet"
2016-10-17 08:35:13 -04:00
"v2ray.com/core/transport/internet/authenticators/noop"
"v2ray.com/core/transport/internet/authenticators/srtp"
"v2ray.com/core/transport/internet/authenticators/utp"
2016-08-08 16:47:59 -04:00
)
func TestAllAuthenticatorLoadable(t *testing.T) {
assert := assert.On(t)
2016-10-17 08:35:13 -04:00
noopAuth, err := CreateAuthenticator(loader.GetType(new(noop.Config)), nil)
2016-08-08 16:47:59 -04:00
assert.Error(err).IsNil()
assert.Int(noopAuth.Overhead()).Equals(0)
2016-10-17 08:35:13 -04:00
srtp, err := CreateAuthenticator(loader.GetType(new(srtp.Config)), nil)
2016-08-08 16:47:59 -04:00
assert.Error(err).IsNil()
assert.Int(srtp.Overhead()).Equals(4)
2016-10-17 08:35:13 -04:00
utp, err := CreateAuthenticator(loader.GetType(new(utp.Config)), nil)
2016-08-08 16:47:59 -04:00
assert.Error(err).IsNil()
assert.Int(utp.Overhead()).Equals(4)
}