MCPcopy Create free account
hub / github.com/facebook/time / TestBitReaderSkip

Function TestBitReaderSkip

rtcm/bits_test.go:78–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestBitReaderSkip(t *testing.T) {
79 w := NewBitWriter(16)
80 w.WriteBits(0xAB, 8)
81 w.WriteBits(0xCD, 8)
82 w.WriteBits(0xEF, 8)
83
84 r := NewBitReader(w.Bytes())
85 r.Skip(8)
86 require.Equal(t, 8, r.Pos())
87 require.Equal(t, uint32(0xCD), r.ReadBits(8))
88 require.Equal(t, uint32(0xEF), r.ReadBits(8))
89}
90
91func TestBitWriterBytePadding(t *testing.T) {
92 // 12 bits written -> 2 bytes, low 4 bits of the last byte are zero padding.

Callers

nothing calls this directly

Calls 7

WriteBitsMethod · 0.95
BytesMethod · 0.95
SkipMethod · 0.95
PosMethod · 0.95
ReadBitsMethod · 0.95
NewBitWriterFunction · 0.85
NewBitReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…