From: Marcel van Lohuizen Date: Fri, 18 Mar 2016 15:41:51 +0000 (+0100) Subject: runtime: don't assume b.N > 0 X-Git-Tag: go1.7beta1~1228 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=872ca73cadf589bd4adf76d0fac9b07c52ac75c8;p=gostls13.git runtime: don't assume b.N > 0 Change-Id: I2e26717f2563d7633ffd15f4adf63c3d0ee3403f Reviewed-on: https://go-review.googlesource.com/20856 Run-TryBot: Marcel van Lohuizen Reviewed-by: Russ Cox --- diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index 7064b0edd8..fd12945be0 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -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