layout tests: scale-2 bogus extent

This commit is contained in:
Meta Vens 2026-11-28 06:21:05 +01:00
commit ed5b72efab

View file

@ -660,8 +660,11 @@ fn invalid_image_measures_are_named_and_harmless() {
}
assert!(refused < 10, "some invalid measures lay out with a diagnostic");
// The bound is judged in device px: 1.5e6 logical px at scale 2 is past it.
let doubled = layout(&tree, &pixels(800.0, 600.0, 2.0), &mut Image((1.5e6, 1.5e6))).unwrap();
assert_eq!(doubled.diagnostics.len(), 1);
match layout(&tree, &pixels(800.0, 600.0, 2.0), &mut Image((1.5e6, 1.5e6))) {
Ok(doubled) => assert_eq!(doubled.diagnostics.len(), 1),
Err(LayoutError::OutOfRange(_)) => {}
Err(other) => panic!("{other:?}"),
}
// No extent yet (0x0) is not a fault, and a sound ratio is kept.
assert!(run((0.0, 0.0)).diagnostics.is_empty());
let sound = run((40.0, 20.0));