From patchwork Wed Apr 25 04:41:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libgo patch committed: Fix crypto/rand test to read all data Date: Tue, 24 Apr 2012 18:41:19 -0000 From: Ian Taylor X-Patchwork-Id: 154791 Message-Id: To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com This patch to libgo fixes the crypto/rand test to read all the data that it needs. This should fix PR 52341. Bootstrapped and ran crypto/rand test on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r c4931780d05a libgo/go/crypto/rand/rand_test.go --- a/libgo/go/crypto/rand/rand_test.go Tue Apr 24 21:24:41 2012 -0700 +++ b/libgo/go/crypto/rand/rand_test.go Tue Apr 24 21:38:23 2012 -0700 @@ -7,6 +7,7 @@ import ( "bytes" "compress/flate" + "io" "testing" ) @@ -16,9 +17,9 @@ 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