Fix: test `DstPort` type

This commit is contained in:
Dreamacro 2023-08-21 23:07:56 +08:00
parent c70c08af96
commit 651a36964e
1 changed files with 6 additions and 6 deletions

View File

@ -550,7 +550,7 @@ func testPacketConnTimeout(t *testing.T, pc net.PacketConn) error {
func testSuit(t *testing.T, proxy C.ProxyAdapter) { func testSuit(t *testing.T, proxy C.ProxyAdapter) {
conn, err := proxy.DialContext(context.Background(), &C.Metadata{ conn, err := proxy.DialContext(context.Background(), &C.Metadata{
Host: localIP.String(), Host: localIP.String(),
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(t, err) require.NoError(t, err)
defer conn.Close() defer conn.Close()
@ -558,7 +558,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
conn, err = proxy.DialContext(context.Background(), &C.Metadata{ conn, err = proxy.DialContext(context.Background(), &C.Metadata{
Host: localIP.String(), Host: localIP.String(),
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(t, err) require.NoError(t, err)
defer conn.Close() defer conn.Close()
@ -571,7 +571,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
pc, err := proxy.ListenPacketContext(context.Background(), &C.Metadata{ pc, err := proxy.ListenPacketContext(context.Background(), &C.Metadata{
NetWork: C.UDP, NetWork: C.UDP,
DstIP: localIP, DstIP: localIP,
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(t, err) require.NoError(t, err)
defer pc.Close() defer pc.Close()
@ -581,7 +581,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{ pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
NetWork: C.UDP, NetWork: C.UDP,
DstIP: localIP, DstIP: localIP,
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(t, err) require.NoError(t, err)
defer pc.Close() defer pc.Close()
@ -591,7 +591,7 @@ func testSuit(t *testing.T, proxy C.ProxyAdapter) {
pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{ pc, err = proxy.ListenPacketContext(context.Background(), &C.Metadata{
NetWork: C.UDP, NetWork: C.UDP,
DstIP: localIP, DstIP: localIP,
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(t, err) require.NoError(t, err)
defer pc.Close() defer pc.Close()
@ -628,7 +628,7 @@ func benchmarkProxy(b *testing.B, proxy C.ProxyAdapter) {
conn, err := proxy.DialContext(context.Background(), &C.Metadata{ conn, err := proxy.DialContext(context.Background(), &C.Metadata{
Host: localIP.String(), Host: localIP.String(),
DstPort: "10001", DstPort: 10001,
}) })
require.NoError(b, err) require.NoError(b, err)