mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +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.RelayTCPPort = "8154"
|
||||||
c.CurveType = "siec"
|
c.CurveType = "siec"
|
||||||
c.Address = "198.199.67.130"
|
c.Address = "198.199.67.130"
|
||||||
|
c.AddressWebsocketPort = "8153"
|
||||||
|
c.AddressTCPPort = "8154"
|
||||||
c.NoRecipientPrompt = true
|
c.NoRecipientPrompt = true
|
||||||
debugLevel := "info"
|
debugLevel := "info"
|
||||||
if debug {
|
if debug {
|
||||||
|
|
|
@ -16,7 +16,8 @@ import (
|
||||||
func sendAndReceive(t *testing.T, forceSend int) {
|
func sendAndReceive(t *testing.T, forceSend int) {
|
||||||
var startTime time.Time
|
var startTime time.Time
|
||||||
var durationPerMegabyte float64
|
var durationPerMegabyte float64
|
||||||
fname := generateRandomFile(100)
|
megabytes := 10
|
||||||
|
fname := generateRandomFile(megabytes)
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(2)
|
wg.Add(2)
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -36,7 +37,7 @@ func sendAndReceive(t *testing.T, forceSend int) {
|
||||||
c.ForceSend = forceSend
|
c.ForceSend = forceSend
|
||||||
startTime = time.Now()
|
startTime = time.Now()
|
||||||
assert.Nil(t, c.Receive("test"))
|
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))
|
assert.True(t, utils.Exists(fname))
|
||||||
}()
|
}()
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue