MCPcopy Create free account
hub / github.com/Edgio/vflow / TestReadCount

Function TestReadCount

reader/reader_test.go:100–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestReadCount(t *testing.T) {
101 b := make([]byte, 18)
102 for i := range b {
103 b[i] = byte(i)
104 }
105 r := NewReader(b)
106 check := func(expected int) {
107 count := r.ReadCount()
108 if count != expected {
109 t.Error("Unexpected ReadCount(). Expected", expected, "got", count)
110 }
111 }
112
113 check(0)
114 r.Uint8()
115 check(1)
116 r.Uint16()
117 check(3)
118 r.Uint32()
119 check(7)
120 r.Uint64()
121 check(15)
122 r.Read(3)
123 check(18)
124}

Callers

nothing calls this directly

Calls 7

ReadCountMethod · 0.95
Uint8Method · 0.95
Uint16Method · 0.95
Uint32Method · 0.95
Uint64Method · 0.95
ReadMethod · 0.95
NewReaderFunction · 0.85

Tested by

no test coverage detected