Skip to content

Commit

Permalink
Histogram adds a leftmost bin
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaecker committed Aug 29, 2024
1 parent bc6f0d0 commit 0c05928
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oximeter/types/src/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1842,13 +1842,14 @@ mod tests {
#[test]
fn test_log_bins_u8() {
let (bins, _) = Histogram::<u8>::power_of_two().bins_and_counts();
assert_eq!(bins, [1, 2, 4, 8, 16, 32, 64, 128],);
assert_eq!(bins, [0, 1, 2, 4, 8, 16, 32, 64, 128],);
}

#[test]
fn test_log_bins_u64() {
let (bins, _) = Histogram::<u64>::power_of_two().bins_and_counts();
for (i, bin) in bins.iter().enumerate() {
assert_eq!(bins[0], 0);
for (i, bin) in bins.iter().skip(1).enumerate() {
assert_eq!(*bin, 1u64 << i);
}
}
Expand Down

0 comments on commit 0c05928

Please sign in to comment.