diff --git a/test/portData_test.go b/test/portData_test.go index a0e295b..f7ed711 100644 --- a/test/portData_test.go +++ b/test/portData_test.go @@ -221,5 +221,3 @@ func TestPortDocVersion(t *testing.T) { } } - - diff --git a/test/utils_test.go b/test/utils_test.go index 965427c..71a651c 100644 --- a/test/utils_test.go +++ b/test/utils_test.go @@ -38,7 +38,7 @@ func TestVariableNameChange(t *testing.T){ } func TestSpeed(t *testing.T){ var tcpAddr *net.TCPAddr - tcpAddr,_ = net.ResolveTCPAddr("tcp","192.168.5.133:7") + tcpAddr,_ = net.ResolveTCPAddr("tcp","192.168.6.103:6500") conn,err := net.DialTCP("tcp",nil,tcpAddr) @@ -48,18 +48,22 @@ func TestSpeed(t *testing.T){ } defer conn.Close() - recv := make([]byte,1024) + recv := make([]byte,128) + i := int32(0) + for ;i < 128;i++ { + recv[i] = byte(i&0xff) + } fmt.Println(conn.LocalAddr().String() + " : Client connected!") - reportTime := time.Now() speed := 0; for { - cnt,e := conn.Write([]byte("123456")) + cnt,_ := conn.Write(recv) speed += cnt - _,e = conn.Read(recv) - if nil != e{ - log.Print(e.Error()) - } + // cnt,e = conn.Read(recv) + // if nil != e{ + // log.Print(e.Error()) + // } + // speed += cnt if(reportTime.Add(time.Second).Before(time.Now())){ reportTime = time.Now() t.Log("speed ",speed," B/S")