Skip to content

Commit

Permalink
Add an equivalence test for the Paeth implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Dec 1, 2024
1 parent 7bfaa49 commit a557386
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,18 @@ mod test {
}
}

#[test]
fn paeth_impls_are_equivalent() {
use super::{filter_paeth, filter_paeth_decode};
for a in 0..=255 {
for b in 0..=255 {
for c in 0..=255 {
assert_eq!(filter_paeth(a, b, c), filter_paeth_decode(a, b, c));
}
}
}
}

#[test]
fn roundtrip_ascending_previous_line() {
// A multiple of 8, 6, 4, 3, 2, 1
Expand Down

0 comments on commit a557386

Please sign in to comment.