MCPcopy
hub / github.com/google/gvisor / TestReadWrite

Function TestReadWrite

pkg/eventfd/eventfd_test.go:22–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func TestReadWrite(t *testing.T) {
23 efd, err := Create()
24 if err != nil {
25 t.Fatalf("failed to Create(): %v", err)
26 }
27 defer efd.Close()
28
29 // Make sure we can read actual values
30 const want = 343
31 if err := efd.Write(want); err != nil {
32 t.Fatalf("failed to write value: %d", want)
33 }
34
35 got, err := efd.Read()
36 if err != nil {
37 t.Fatalf("failed to read value: %v", err)
38 }
39 if got != want {
40 t.Fatalf("Read(): got %d, but wanted %d", got, want)
41 }
42}
43
44func TestWait(t *testing.T) {
45 efd, err := Create()

Callers

nothing calls this directly

Calls 5

CreateFunction · 0.70
FatalfMethod · 0.65
CloseMethod · 0.65
WriteMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…