Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(935)

Side by Side Diff: src/pkg/sync/once_test.go

Issue 96910043: code review 96910043: testing: RunParallel and SetParallelism are misleading. (Closed)
Patch Set: diff -r 7f529f73708a http://code.google.com/p/go Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/sync/mutex_test.go ('k') | src/pkg/sync/pool_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package sync_test 5 package sync_test
6 6
7 import ( 7 import (
8 . "sync" 8 . "sync"
9 "testing" 9 "testing"
10 ) 10 )
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 once.Do(func() {}) 56 once.Do(func() {})
57 once.Do(func() { 57 once.Do(func() {
58 t.Fatalf("Once called twice") 58 t.Fatalf("Once called twice")
59 }) 59 })
60 } 60 }
61 61
62 func BenchmarkOnce(b *testing.B) { 62 func BenchmarkOnce(b *testing.B) {
63 var once Once 63 var once Once
64 f := func() {} 64 f := func() {}
65 » b.RunParallel(func(pb *testing.PB) { 65 » b.RunConcurrent(func(pb *testing.PB) {
66 for pb.Next() { 66 for pb.Next() {
67 once.Do(f) 67 once.Do(f)
68 } 68 }
69 }) 69 })
70 } 70 }
OLDNEW
« no previous file with comments | « src/pkg/sync/mutex_test.go ('k') | src/pkg/sync/pool_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b