]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't assume b.N > 0
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 18 Mar 2016 15:41:51 +0000 (16:41 +0100)
committerRuss Cox <rsc@golang.org>
Fri, 18 Mar 2016 15:55:02 +0000 (15:55 +0000)
Change-Id: I2e26717f2563d7633ffd15f4adf63c3d0ee3403f
Reviewed-on: https://go-review.googlesource.com/20856
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/proc_test.go

index 7064b0edd86282e8ec1869de99ea31999fb8278d..fd12945be0c35edc5eec1c1d5a0fc36d80a91afe 100644 (file)
@@ -428,6 +428,9 @@ func TestPingPongHog(t *testing.T) {
 }
 
 func BenchmarkPingPongHog(b *testing.B) {
+       if b.N == 0 {
+               return
+       }
        defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
 
        // Create a CPU hog