(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestTotalSystemMemoryBytes(t *testing.T) { |
| 61 | if runtime.GOOS != "linux" { |
| 62 | t.Skip("Only runs on Linux") |
| 63 | } |
| 64 | |
| 65 | total := readSystemMemoryBytes() |
| 66 | if total == 0 { |
| 67 | t.Fatal("Expected non-zero memory on Linux") |
| 68 | } |
| 69 | |
| 70 | // Sanity check: at least 64MB (any reasonable system) |
| 71 | if total < 64*1024*1024 { |
| 72 | t.Fatalf("Suspiciously low memory: %d bytes", total) |
| 73 | } |
| 74 | t.Logf("System memory: %d bytes (%.1f GB)", total, float64(total)/(1024*1024*1024)) |
| 75 | } |
| 76 | |
| 77 | func TestParseMemoryBytes(t *testing.T) { |
| 78 | tests := []struct { |
nothing calls this directly
no test coverage detected