Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Sep 14, 2024
1 parent 1f1b33d commit b7169d2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions accounts-db/src/ancient_append_vecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,14 @@ pub mod tests {
&tuning,
many_ref_slots,
);
let expected_accounts_to_combine = num_slots;
let expected_accounts_to_combine = if num_slots >= 3
&& two_refs
&& many_ref_slots == IncludeManyRefSlots::Skip
{
0
} else {
num_slots
};
(0..accounts_to_combine
.target_slots_sorted
.len()
Expand Down Expand Up @@ -1864,7 +1871,8 @@ pub mod tests {
assert_eq!(
accounts_to_combine.accounts_to_combine.len(),
// if we are only trying to pack a single slot of multi-refs, it will succeed
if !two_refs || many_ref_slots == IncludeManyRefSlots::Include || num_slots == 1 || num_slots == 2 {num_slots} else {0},
// if num_slots = 2 and skip multi-ref slots, accounts_to_combine should be empty.
if !two_refs || many_ref_slots == IncludeManyRefSlots::Include || num_slots == 1 || (num_slots == 2 && many_ref_slots != IncludeManyRefSlots::Skip) {num_slots} else {0},
"method: {method:?}, num_slots: {num_slots}, two_refs: {two_refs}, many_refs: {many_ref_slots:?}"
);

Expand Down

0 comments on commit b7169d2

Please sign in to comment.