diff options
author | Marcel van Lohuizen <mpvl@golang.org> | 2016-03-18 16:41:51 +0100 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2016-03-18 15:55:02 +0000 |
commit | 872ca73cadf589bd4adf76d0fac9b07c52ac75c8 (patch) | |
tree | 3ba7907114d4d6e0362b4dafe1ce9103d2797f75 /src/runtime/proc_test.go | |
parent | 3e2e80599e112c6cb6ad3fb82aa15660603c4571 (diff) | |
download | go-872ca73cadf589bd4adf76d0fac9b07c52ac75c8.tar.gz go-872ca73cadf589bd4adf76d0fac9b07c52ac75c8.zip |
runtime: don't assume b.N > 0
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>
Diffstat (limited to 'src/runtime/proc_test.go')
-rw-r--r-- | src/runtime/proc_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 |