MCPcopy Create free account
hub / github.com/prometheus/procfs / TestFileDescriptors

Function TestFileDescriptors

proc_test.go:199–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestFileDescriptors(t *testing.T) {
200 p1, err := getProcFixtures(t).Proc(26231)
201 if err != nil {
202 t.Fatal(err)
203 }
204 fds, err := p1.FileDescriptors()
205 if err != nil {
206 t.Fatal(err)
207 }
208 sort.Sort(byUintptr(fds))
209 if want := []uintptr{0, 1, 2, 3, 10}; !reflect.DeepEqual(want, fds) {
210 t.Errorf("want fds %v, have %v", want, fds)
211 }
212}
213
214func TestFileDescriptorTargets(t *testing.T) {
215 p1, err := getProcFixtures(t).Proc(26231)

Callers

nothing calls this directly

Calls 4

getProcFixturesFunction · 0.85
byUintptrTypeAlias · 0.85
ProcMethod · 0.80
FileDescriptorsMethod · 0.80

Tested by

no test coverage detected