Commit 639dc6c7 authored by Sanjay Menakuru's avatar Sanjay Menakuru Committed by Dmitriy Vyukov

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
parent 38ce5994
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment