MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestMemInfo

Function TestMemInfo

metric/meminfo_linux_test.go:8–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestMemInfo(t *testing.T) {
9 file, err := os.Open("fixtures/proc/meminfo")
10 if err != nil {
11 t.Fatal(err)
12 }
13 defer file.Close()
14
15 memInfo, err := parseMemInfo(file)
16 if err != nil {
17 t.Fatal(err)
18 }
19
20 if want, got := 3831959552.0, memInfo["MemTotal_bytes"]; want != got {
21 t.Errorf("want memory total %f, got %f", want, got)
22 }
23
24 if want, got := 3787456512.0, memInfo["DirectMap2M_bytes"]; want != got {
25 t.Errorf("want memory directMap2M %f, got %f", want, got)
26 }
27}

Callers

nothing calls this directly

Calls 5

parseMemInfoFunction · 0.85
FatalMethod · 0.80
ErrorfMethod · 0.80
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected