mirror of https://github.com/v2ray/v2ray-core
fix test break
parent
40f890e638
commit
3cb60fac90
|
@ -8,20 +8,20 @@ import (
|
||||||
|
|
||||||
"v2ray.com/core/testing/assert"
|
"v2ray.com/core/testing/assert"
|
||||||
"v2ray.com/core/testing/servers/tcp"
|
"v2ray.com/core/testing/servers/tcp"
|
||||||
|
. "v2ray.com/core/transport/internet/tcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetOriginalDestination(t *testing.T) {
|
func TestGetOriginalDestination(t *testing.T) {
|
||||||
assert := assert.On(t)
|
assert := assert.On(t)
|
||||||
|
|
||||||
tcpServer := tcp.Server{
|
tcpServer := tcp.Server{}
|
||||||
MsgProcessor: xor,
|
|
||||||
}
|
|
||||||
dest, err := tcpServer.Start()
|
dest, err := tcpServer.Start()
|
||||||
assert.Error(err).IsNil()
|
assert.Error(err).IsNil()
|
||||||
defer tcpServer.Close()
|
defer tcpServer.Close()
|
||||||
|
|
||||||
conn, err := Dial(context.Background(), dest)
|
conn, err := Dial(context.Background(), dest)
|
||||||
assert.Error(err).IsNil()
|
assert.Error(err).IsNil()
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
_, err := GetOriginalDestination(conn)
|
_, err := GetOriginalDestination(conn)
|
||||||
assert.String(err.Error()).Contains("failed to call getsockopt")
|
assert.String(err.Error()).Contains("failed to call getsockopt")
|
||||||
|
|
Loading…
Reference in New Issue