mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
fix test
This commit is contained in:
parent
f6c2382c0a
commit
7891f27b62
2 changed files with 5 additions and 2 deletions
|
@ -59,6 +59,8 @@ func Init(debug bool) (c *Croc) {
|
|||
c.RelayTCPPort = "8154"
|
||||
c.CurveType = "siec"
|
||||
c.Address = "198.199.67.130"
|
||||
c.AddressWebsocketPort = "8153"
|
||||
c.AddressTCPPort = "8154"
|
||||
c.NoRecipientPrompt = true
|
||||
debugLevel := "info"
|
||||
if debug {
|
||||
|
|
|
@ -16,7 +16,8 @@ import (
|
|||
func sendAndReceive(t *testing.T, forceSend int) {
|
||||
var startTime time.Time
|
||||
var durationPerMegabyte float64
|
||||
fname := generateRandomFile(100)
|
||||
megabytes := 10
|
||||
fname := generateRandomFile(megabytes)
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
|
@ -36,7 +37,7 @@ func sendAndReceive(t *testing.T, forceSend int) {
|
|||
c.ForceSend = forceSend
|
||||
startTime = time.Now()
|
||||
assert.Nil(t, c.Receive("test"))
|
||||
durationPerMegabyte = 100.0 / time.Since(startTime).Seconds()
|
||||
durationPerMegabyte = float64(megabytes) / time.Since(startTime).Seconds()
|
||||
assert.True(t, utils.Exists(fname))
|
||||
}()
|
||||
wg.Wait()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue