Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
2acaf71e
Commit
2acaf71e
authored
Jun 03, 2015
by
rht
Browse files
Swap all 'crypto/rand' rng in tests with 'math/rand'
parent
9839d64f
Changes
2
Show whitespace changes
Inline
Side-by-side
test/backpressure/backpressure_test.go
View file @
2acaf71e
package
backpressure_tests
package
backpressure_tests
import
(
import
(
crand
"crypto/rand"
"io"
"io"
"math/rand"
"math/rand"
"testing"
"testing"
...
@@ -15,6 +14,7 @@ import (
...
@@ -15,6 +14,7 @@ import (
eventlog
"github.com/ipfs/go-ipfs/thirdparty/eventlog"
eventlog
"github.com/ipfs/go-ipfs/thirdparty/eventlog"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
u
"github.com/ipfs/go-ipfs/util"
)
)
var
log
=
eventlog
.
Logger
(
"backpressure"
)
var
log
=
eventlog
.
Logger
(
"backpressure"
)
...
@@ -236,7 +236,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
...
@@ -236,7 +236,7 @@ func TestStBackpressureStreamWrite(t *testing.T) {
// ready a buffer of random data
// ready a buffer of random data
buf
:=
make
([]
byte
,
65536
)
buf
:=
make
([]
byte
,
65536
)
cr
and
.
Read
(
buf
)
u
.
NewTimeSeededR
and
()
.
Read
(
buf
)
for
{
for
{
// send a randomly sized subchunk
// send a randomly sized subchunk
...
...
test/reconnects/reconnect_test.go
View file @
2acaf71e
package
reconnect
package
reconnect
import
(
import
(
crand
"crypto/rand"
"io"
"io"
"math/rand"
"math/rand"
"sync"
"sync"
...
@@ -14,6 +13,7 @@ import (
...
@@ -14,6 +13,7 @@ import (
protocol
"github.com/ipfs/go-ipfs/p2p/protocol"
protocol
"github.com/ipfs/go-ipfs/p2p/protocol"
testutil
"github.com/ipfs/go-ipfs/p2p/test/util"
testutil
"github.com/ipfs/go-ipfs/p2p/test/util"
eventlog
"github.com/ipfs/go-ipfs/thirdparty/eventlog"
eventlog
"github.com/ipfs/go-ipfs/thirdparty/eventlog"
u
"github.com/ipfs/go-ipfs/util"
ps
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
ps
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-peerstream"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
...
@@ -66,7 +66,7 @@ func newSender() (chan sendChans, func(s inet.Stream)) {
...
@@ -66,7 +66,7 @@ func newSender() (chan sendChans, func(s inet.Stream)) {
buf
:=
make
([]
byte
,
65536
)
buf
:=
make
([]
byte
,
65536
)
buf2
:=
make
([]
byte
,
65536
)
buf2
:=
make
([]
byte
,
65536
)
cr
and
.
Read
(
buf
)
u
.
NewTimeSeededR
and
()
.
Read
(
buf
)
for
{
for
{
select
{
select
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment