1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:40:04 -07:00

runtime: better error from TestGcSys when gc is disabled

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7390047
This commit is contained in:
Russ Cox 2013-02-21 13:30:31 -05:00
parent 94fab3cad3
commit 5833c96b0a

View File

@ -5,11 +5,15 @@
package runtime_test
import (
"os"
"runtime"
"testing"
)
func TestGcSys(t *testing.T) {
if os.Getenv("GOGC") == "off" {
t.Fatalf("GOGC=off in environment; test cannot pass")
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
memstats := new(runtime.MemStats)
runtime.GC()