v2ray-core/transport/internet/authenticator_test.go

28 lines
718 B
Go
Raw Normal View History

2016-08-08 20:47:59 +00:00
package internet_test
import (
"testing"
2016-08-20 18:55:45 +00:00
"v2ray.com/core/testing/assert"
. "v2ray.com/core/transport/internet"
_ "v2ray.com/core/transport/internet/authenticators/noop"
_ "v2ray.com/core/transport/internet/authenticators/srtp"
_ "v2ray.com/core/transport/internet/authenticators/utp"
2016-08-08 20:47:59 +00:00
)
func TestAllAuthenticatorLoadable(t *testing.T) {
assert := assert.On(t)
noopAuth, err := CreateAuthenticator("none", nil)
assert.Error(err).IsNil()
assert.Int(noopAuth.Overhead()).Equals(0)
srtp, err := CreateAuthenticator("srtp", nil)
assert.Error(err).IsNil()
assert.Int(srtp.Overhead()).Equals(4)
utp, err := CreateAuthenticator("utp", nil)
assert.Error(err).IsNil()
assert.Int(utp.Overhead()).Equals(4)
}