From bbda9955e9eedace653a838f434e7029a0c85e0b Mon Sep 17 00:00:00 2001 From: Issac Trotts Date: Wed, 11 Jul 2018 09:20:32 -0700 Subject: [PATCH] Fix issue 297: TestCounterEncStreamHistogram broken in go1.11. This doubles the number of samples to reduce the variance in the estimates. --- counterecryptor_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/counterecryptor_test.go b/counterecryptor_test.go index 12b31e16..7362180c 100644 --- a/counterecryptor_test.go +++ b/counterecryptor_test.go @@ -4,11 +4,12 @@ import ( "bytes" "crypto/rsa" "encoding/binary" - "github.com/elazarl/goproxy" "io" "math" "math/rand" "testing" + + "github.com/elazarl/goproxy" ) type RandSeedReader struct { @@ -82,11 +83,11 @@ func TestCounterEncStreamHistogram(t *testing.T) { nout := 100 * 1000 out := make([]byte, nout) io.ReadFull(&c, out) - refhist := make([]int, 256) + refhist := make([]int, 512) for i := 0; i < nout; i++ { refhist[rand.Intn(256)]++ } - hist := make([]int, 256) + hist := make([]int, 512) for _, b := range out { hist[int(b)]++ }