From: Dmitriy Vyukov Date: Thu, 19 Jan 2012 12:17:44 +0000 (+0400) Subject: math/rand: decrease test duration in short mode X-Git-Tag: weekly.2012-01-20~27 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f2f0059307e3ff555858b2d51493187f467c17e2;p=gostls13.git math/rand: decrease test duration in short mode TestNonStandardNormalValues runs 1.5s, the change reduces it to 0.2s in short mode. The problem is with slow machines, emulators and dynamic tools. R=golang-dev, r CC=golang-dev https://golang.org/cl/5540065 --- diff --git a/src/pkg/math/rand/rand_test.go b/src/pkg/math/rand/rand_test.go index 76215a978a..0ba8f98c49 100644 --- a/src/pkg/math/rand/rand_test.go +++ b/src/pkg/math/rand/rand_test.go @@ -131,8 +131,14 @@ func TestStandardNormalValues(t *testing.T) { } func TestNonStandardNormalValues(t *testing.T) { - for sd := 0.5; sd < 1000; sd *= 2 { - for m := 0.5; m < 1000; m *= 2 { + sdmax := 1000.0 + mmax := 1000.0 + if testing.Short() { + sdmax = 5 + mmax = 5 + } + for sd := 0.5; sd < sdmax; sd *= 2 { + for m := 0.5; m < mmax; m *= 2 { for _, seed := range testSeeds { testNormalDistribution(t, numTestSamples, m, sd, seed) }