]> Cypherpunks repositories - gostls13.git/commitdiff
math/rand: decrease test duration in short mode
authorDmitriy Vyukov <dvyukov@google.com>
Thu, 19 Jan 2012 12:17:44 +0000 (16:17 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Thu, 19 Jan 2012 12:17:44 +0000 (16:17 +0400)
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

src/pkg/math/rand/rand_test.go

index 76215a978afb05fbcb585d977b5a69dd5ff82acb..0ba8f98c4965ba493511c213783eff819d4687fe 100644 (file)
@@ -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)
                        }