From: Ian Lance Taylor Date: Wed, 25 Apr 2012 04:36:42 +0000 (-0700) Subject: crypto/rand: use io.ReadFull in test X-Git-Tag: go1.1rc2~3320 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=990f3af72b36ac8d9a78b8b8621d248af490f8be;p=gostls13.git crypto/rand: use io.ReadFull in test On Solaris versions before Solaris 11, the kernel will not return more than 1040 on a single read from /dev/urandom. R=golang-dev, agl, bradfitz, rsc, iant, dchest CC=golang-dev https://golang.org/cl/6113046 --- diff --git a/src/pkg/crypto/rand/rand_test.go b/src/pkg/crypto/rand/rand_test.go index be3a5a221d..da091ba8c7 100644 --- a/src/pkg/crypto/rand/rand_test.go +++ b/src/pkg/crypto/rand/rand_test.go @@ -7,6 +7,7 @@ package rand import ( "bytes" "compress/flate" + "io" "testing" ) @@ -16,9 +17,9 @@ func TestRead(t *testing.T) { n = 1e5 } b := make([]byte, n) - n, err := Read(b) + n, err := io.ReadFull(Reader, b) if n != len(b) || err != nil { - t.Fatalf("Read(buf) = %d, %s", n, err) + t.Fatalf("ReadFull(buf) = %d, %s", n, err) } var z bytes.Buffer