cmd/swarm, swarm/api/http, swarm/bmt, swarm/fuse, swarm/network/stream, swarm/storage, swarm/storage/encryption, swarm/testutil: use pseudo-random instead of crypto-random for test files content generation (#18083)
- Replace "crypto/rand" to "math/rand" for files content generation - Remove swarm/network_test.go.Shuffle and swarm/btm/btm_test.go.Shuffle - because go1.9 support dropped (see https://github.com/ethereum/go-ethereum/pull/17807 and comments to swarm/network_test.go.Shuffle)
This commit is contained in:
committed by
Viktor Trón
parent
cff97119a7
commit
eb8fa3cc89
@@ -24,12 +24,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
|
||||
"github.com/ethereum/go-ethereum/swarm/testutil"
|
||||
)
|
||||
|
||||
func TestError(t *testing.T) {
|
||||
srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
|
||||
srv := NewTestSwarmServer(t, serverFunc, nil)
|
||||
defer srv.Close()
|
||||
|
||||
var resp *http.Response
|
||||
@@ -55,7 +53,7 @@ func TestError(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test404Page(t *testing.T) {
|
||||
srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
|
||||
srv := NewTestSwarmServer(t, serverFunc, nil)
|
||||
defer srv.Close()
|
||||
|
||||
var resp *http.Response
|
||||
@@ -81,7 +79,7 @@ func Test404Page(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test500Page(t *testing.T) {
|
||||
srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
|
||||
srv := NewTestSwarmServer(t, serverFunc, nil)
|
||||
defer srv.Close()
|
||||
|
||||
var resp *http.Response
|
||||
@@ -106,7 +104,7 @@ func Test500Page(t *testing.T) {
|
||||
}
|
||||
}
|
||||
func Test500PageWith0xHashPrefix(t *testing.T) {
|
||||
srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
|
||||
srv := NewTestSwarmServer(t, serverFunc, nil)
|
||||
defer srv.Close()
|
||||
|
||||
var resp *http.Response
|
||||
@@ -136,7 +134,7 @@ func Test500PageWith0xHashPrefix(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestJsonResponse(t *testing.T) {
|
||||
srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
|
||||
srv := NewTestSwarmServer(t, serverFunc, nil)
|
||||
defer srv.Close()
|
||||
|
||||
var resp *http.Response
|
||||
|
Reference in New Issue
Block a user