Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

#2504: the dehaze regression test also fails when the whole dark field renders black

Claudec21714a379eb
diff --git a/crates/pipeline/src/tests.rs b/crates/pipeline/src/tests.rs
index f31e96f59..23eca0ba7 100644
--- a/crates/pipeline/src/tests.rs
+++ b/crates/pipeline/src/tests.rs
@@ -96,6 +96,8 @@ fn dehaze_does_not_crush_dark_regions_next_to_bright_ones() {
}
v.sort_unstable();
let mid = v[v.len() / 2] as i32;
+ // a field rendered all black would pass the comparison below vacuously
+ assert!(mid > 2, "the dark field itself is crushed in ch {ch}: level {mid}");
for y in 0..160 {
for x in 0..120 {
let p = r.get(x, y)[ch] as i32;