MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / TestIncrementSimple

Function TestIncrementSimple

roaring64/bsi64_test.go:539–553  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

537}
538
539func TestIncrementSimple(t *testing.T) {
540 bsi := setup()
541 bsi.IncrementAll()
542 for i := 0; i < int(bsi.MaxValue); i++ {
543 a, _ := bsi.GetValue(uint64(i))
544 assert.Equal(t, int64(i+1), a)
545 }
546 bsi.Increment(BitmapOf(0))
547 x, _ := bsi.GetValue(uint64(0))
548 assert.Equal(t, int64(2), x)
549 for i := 1; i < int(bsi.MaxValue); i++ {
550 a, _ := bsi.GetValue(uint64(i))
551 assert.Equal(t, int64(i+1), a)
552 }
553}
554
555func TestIncrementFromZero(t *testing.T) {
556 bsi := NewDefaultBSI()

Callers

nothing calls this directly

Calls 5

setupFunction · 0.70
BitmapOfFunction · 0.70
IncrementAllMethod · 0.45
GetValueMethod · 0.45
IncrementMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…