Remove use of crypto rand in tests

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2018-07-12 15:16:08 -07:00
parent cce0a46c8a
commit 1c6929cbd4
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB
2 changed files with 4 additions and 5 deletions

View File

@ -18,8 +18,8 @@ package compression
import ( import (
"bytes" "bytes"
"crypto/rand"
"io/ioutil" "io/ioutil"
"math/rand"
"testing" "testing"
) )

View File

@ -20,12 +20,11 @@ import (
"bufio" "bufio"
"bytes" "bytes"
"context" "context"
"crypto/rand"
_ "crypto/sha256" // required for digest package _ "crypto/sha256" // required for digest package
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
mrand "math/rand" "math/rand"
"os" "os"
"path/filepath" "path/filepath"
"reflect" "reflect"
@ -266,9 +265,9 @@ func generateBlobs(t checker, nblobs, maxsize int64) map[digest.Digest][]byte {
blobs := map[digest.Digest][]byte{} blobs := map[digest.Digest][]byte{}
for i := int64(0); i < nblobs; i++ { for i := int64(0); i < nblobs; i++ {
p := make([]byte, mrand.Int63n(maxsize)) p := make([]byte, rand.Int63n(maxsize))
if _, err := mrand.Read(p); err != nil { if _, err := rand.Read(p); err != nil {
t.Fatal(err) t.Fatal(err)
} }