mirror of
https://github.com/golang/go
synced 2024-11-19 02:04:42 -07:00
runtime: Loosen conditions in TestMemstat in an attempt to fix the nacl/arm build.
LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews, khr https://golang.org/cl/128680043
This commit is contained in:
parent
38ce599494
commit
639dc6c794
@ -17,10 +17,10 @@ func TestMemStats(t *testing.T) {
|
||||
st := new(MemStats)
|
||||
ReadMemStats(st)
|
||||
|
||||
// Everything except HeapReleased, because it indeed can be 0.
|
||||
// Everything except HeapReleased and HeapIdle, because they indeed can be 0.
|
||||
if st.Alloc == 0 || st.TotalAlloc == 0 || st.Sys == 0 || st.Lookups == 0 ||
|
||||
st.Mallocs == 0 || st.Frees == 0 || st.HeapAlloc == 0 || st.HeapSys == 0 ||
|
||||
st.HeapIdle == 0 || st.HeapInuse == 0 || st.HeapObjects == 0 || st.StackInuse == 0 ||
|
||||
st.HeapInuse == 0 || st.HeapObjects == 0 || st.StackInuse == 0 ||
|
||||
st.StackSys == 0 || st.MSpanInuse == 0 || st.MSpanSys == 0 || st.MCacheInuse == 0 ||
|
||||
st.MCacheSys == 0 || st.BuckHashSys == 0 || st.GCSys == 0 || st.OtherSys == 0 ||
|
||||
st.NextGC == 0 || st.NumGC == 0 {
|
||||
@ -40,6 +40,10 @@ func TestMemStats(t *testing.T) {
|
||||
st.BuckHashSys+st.GCSys+st.OtherSys {
|
||||
t.Fatalf("Bad sys value: %+v", *st)
|
||||
}
|
||||
|
||||
if st.HeapIdle+st.HeapInuse != st.HeapSys {
|
||||
t.Fatalf("HeapIdle(%d) + HeapInuse(%d) should be equal to HeapSys(%d), but isn't.", st.HeapIdle, st.HeapInuse, st.HeapSys)
|
||||
}
|
||||
}
|
||||
|
||||
var mallocSink uintptr
|
||||
|
Loading…
Reference in New Issue
Block a user