File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ void run_container_offset(const run_container_t *c,
131
131
lo_cap = c -> n_runs ;
132
132
hi_cap = 0 ;
133
133
} else {
134
- split = c -> runs [pivot ].value <= top ;
134
+ split = c -> runs [pivot ].value < top ;
135
135
lo_cap = pivot + (split ? 1 : 0 );
136
136
hi_cap = c -> n_runs - pivot ;
137
137
}
Original file line number Diff line number Diff line change @@ -46,6 +46,17 @@ bool roaring_iterator_sumall(uint32_t value, void *param) {
46
46
* (uint32_t * )param += value ;
47
47
return true; // continue till the end
48
48
}
49
+ DEFINE_TEST (issue457 ) {
50
+ roaring_bitmap_t * r1 = roaring_bitmap_from_range (65539 , 65541 , 1 );
51
+ roaring_bitmap_printf_describe (r1 );
52
+ assert_true (roaring_bitmap_get_cardinality (r1 ) == 2 );
53
+ roaring_bitmap_t * r2 = roaring_bitmap_add_offset (r1 , -3 );
54
+ roaring_bitmap_printf_describe (r2 );
55
+ assert_true (roaring_bitmap_get_cardinality (r2 ) == 2 );
56
+ roaring_bitmap_printf (r2 );
57
+ roaring_bitmap_free (r1 );
58
+ roaring_bitmap_free (r2 );
59
+ }
49
60
50
61
DEFINE_TEST (issue429 ) {
51
62
// This is a memory leak test, so we don't need to check the results.
@@ -4440,6 +4451,7 @@ int main() {
4440
4451
tellmeall ();
4441
4452
4442
4453
const struct CMUnitTest tests [] = {
4454
+ cmocka_unit_test (issue457 ),
4443
4455
cmocka_unit_test (convert_to_bitset ),
4444
4456
cmocka_unit_test (issue440 ),
4445
4457
cmocka_unit_test (issue436 ),
You can’t perform that action at this time.
0 commit comments