1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 // TestConcurrent exercises the rand API concurrently, triggering situations
14 // where the race detector is likely to detect issues.
15 func TestConcurrent(t *testing.T) {
23 for i := 0; i < numRoutines; i++ {
26 buf := make([]byte, 997)
27 for j := 0; j < numCycles; j++ {
29 seed += int64(ExpFloat64())
30 seed += int64(Float32())
31 seed += int64(Float64())
32 seed += int64(IntN(Int()))
33 seed += int64(Int32N(Int32()))
34 seed += int64(Int64N(Int64()))
35 seed += int64(NormFloat64())
36 seed += int64(Uint32())
37 seed += int64(Uint64())
38 for _, p := range Perm(10) {
42 for _, b := range buf {
45 Seed(int64(i*j) * seed)