MCPcopy Create free account
hub / github.com/AdRoll/baker / Test_bitmap_setBit

Function Test_bitmap_setBit

pkg/buffercache/bitmap_test.go:107–204  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func Test_bitmap_setBit(t *testing.T) {
108 tests := []struct {
109 bm bitmap
110 index int
111 want bitmap
112 panic bool
113 }{
114 {
115 bm: bitmap([]uint64{
116 0b0000000000000000000000000000000000000000000000000000000000000000,
117 0b0000000000000000000000000000000000000000000000000000000000000000,
118 }),
119 index: 0,
120 want: bitmap([]uint64{
121 0b0000000000000000000000000000000000000000000000000000000000000001,
122 0b0000000000000000000000000000000000000000000000000000000000000000,
123 }),
124 },
125 {
126 bm: bitmap([]uint64{
127 0b0000000000000000000000000000000000000000000000000000000000000000,
128 0b0000000000000000000000000000000000000000000000000000000000000000,
129 }),
130 index: 64,
131 want: bitmap([]uint64{
132 0b0000000000000000000000000000000000000000000000000000000000000000,
133 0b0000000000000000000000000000000000000000000000000000000000000001,
134 }),
135 },
136 {
137 bm: bitmap([]uint64{
138 0b0000000000000000000000000000000000000000000000000000000000000000,
139 0b0000000000000000000000000000000000000000000000000000000000000000,
140 }),
141 index: 127,
142 want: bitmap([]uint64{
143 0b0000000000000000000000000000000000000000000000000000000000000000,
144 0b1000000000000000000000000000000000000000000000000000000000000000,
145 }),
146 },
147 {
148 bm: bitmap([]uint64{
149 0b0000000000000000000000000000000000000000000000000000000000000000,
150 0b0000000000000000000000000000000000000000000000000000000000000000,
151 }),
152 index: 63,
153 want: bitmap([]uint64{
154 0b1000000000000000000000000000000000000000000000000000000000000000,
155 0b0000000000000000000000000000000000000000000000000000000000000000,
156 }),
157 },
158 {
159 bm: bitmap([]uint64{
160 0b0000000000000000000000000000000000000000000000000000000000000000,
161 0b0000000000000000000000000000000000000000000000000000000000000000,
162 }),
163 index: 64 + 33,
164 want: bitmap([]uint64{

Callers

nothing calls this directly

Calls 3

bitmapTypeAlias · 0.85
setBitMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected