MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / TestRoaringBitmapAddOffset

Function TestRoaringBitmapAddOffset

roaring_test.go:742–807  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

740}
741
742func TestRoaringBitmapAddOffset(t *testing.T) {
743 type testCase struct {
744 arr []uint32
745 offset int64
746 }
747 cases := []testCase{
748 {
749 arr: []uint32{5580, 33722, 44031, 57276, 83097},
750 offset: 25000,
751 },
752 {
753 arr: []uint32{5580, 33722, 44031, 57276, 83097},
754 offset: -25000,
755 },
756 {
757 arr: []uint32{5580, 33722, 44031, 57276, 83097},
758 offset: -83097,
759 },
760 {
761 arr: []uint32{5580, 33722, 44031, 57276, 83097},
762 offset: MaxUint32,
763 },
764 {
765 arr: []uint32{5580, 33722, 44031, 57276, 83097},
766 offset: -MaxUint32,
767 },
768 {
769 arr: []uint32{5580, 33722, 44031, 57276, 83097},
770 offset: 0,
771 },
772 {
773 arr: []uint32{0},
774 offset: 100,
775 },
776 {
777 arr: []uint32{0},
778 offset: 0xffff0000,
779 },
780 {
781 arr: []uint32{0},
782 offset: 0xffff0001,
783 },
784 }
785
786 arr := []uint32{10, 0xffff, 0x010101}
787 for i := uint32(100000); i < 200000; i += 4 {
788 arr = append(arr, i)
789 }
790 arr = append(arr, 400000)
791 arr = append(arr, 1400000)
792 for offset := int64(3); offset < 1000000; offset *= 3 {
793 c := testCase{arr, offset}
794 cases = append(cases, c)
795 }
796 for offset := int64(1024); offset < 1000000; offset *= 2 {
797 c := testCase{arr, offset}
798 cases = append(cases, c)
799 }

Callers

nothing calls this directly

Calls 1

testAddOffsetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…