[mem][darwin] Fix #622 include Inactive memory in total calculation in TestVirtual_memory

This commit is contained in:
Lomanic 2018-12-25 21:55:58 +01:00
parent 4104adff3e
commit ccc1c1016b
1 changed files with 6 additions and 3 deletions

View File

@ -28,11 +28,14 @@ func TestVirtual_memory(t *testing.T) {
total := v.Used + v.Free + v.Buffers + v.Cached
totalStr := "used + free + buffers + cached"
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "windows":
total = v.Used + v.Available
totalStr = "used + available"
}
if runtime.GOOS == "freebsd" {
case "darwin":
total = v.Used + v.Free + v.Cached + v.Inactive
totalStr = "used + free + cached + inactive"
case "freebsd":
total = v.Used + v.Free + v.Cached + v.Inactive + v.Laundry
totalStr = "used + free + cached + inactive + laundry"
}