cpu: fix cpu test on small ARM device where CPU can be at 100%+rounding.

Fixes #99
pull/103/head
Daniel Theophanes 10 years ago
parent 0af895258e
commit 726e7c6406

@ -82,7 +82,8 @@ func testCPUPercent(t *testing.T, percpu bool) {
t.Errorf("error %v", err)
}
for _, percent := range v {
if percent < 0.0 || percent > 100.0*float64(numcpu) {
// Check for slightly greater then 100% to account for any rounding issues.
if percent < 0.0 || percent > 100.0001*float64(numcpu) {
t.Fatalf("CPUPercent value is invalid: %f", percent)
}
}

Loading…
Cancel
Save