(t *testing.T)
| 215 | } |
| 216 | |
| 217 | func TestBitmapOffset(t *testing.T) { |
| 218 | nums := []uint16{10, 60, 70, 100, 1000} |
| 219 | expected := make([]int, len(nums)) |
| 220 | offtest := uint16(65000) |
| 221 | v := container(newBitmapContainer()) |
| 222 | for i, n := range nums { |
| 223 | v.iadd(n) |
| 224 | expected[i] = int(n) + int(offtest) |
| 225 | } |
| 226 | l, h := v.addOffset(offtest) |
| 227 | |
| 228 | var w0card, w1card int |
| 229 | wout := make([]int, len(nums)) |
| 230 | |
| 231 | if l != nil { |
| 232 | w0card = l.getCardinality() |
| 233 | |
| 234 | for i := 0; i < w0card; i++ { |
| 235 | wout[i] = l.selectInt(uint16(i)) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | if h != nil { |
| 240 | w1card = h.getCardinality() |
| 241 | |
| 242 | for i := 0; i < w1card; i++ { |
| 243 | wout[i+w0card] = h.selectInt(uint16(i)) + 65536 |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | assert.Equal(t, v.getCardinality(), w0card+w1card) |
| 248 | for i, x := range wout { |
| 249 | assert.Equal(t, expected[i], x) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestBitmapContainerResetTo(t *testing.T) { |
| 254 | array := newArrayContainer() |
nothing calls this directly
no test coverage detected
searching dependent graphs…