This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgo patch committed: Fix crypto/rand test to read all data
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 24 Apr 2012 21:41:19 -0700
- Subject: libgo patch committed: Fix crypto/rand test to read all data
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