diff --git a/crates/ec-ac3/src/stack_budget.rs b/crates/ec-ac3/src/stack_budget.rs index 10d14ee0..6f6676f0 100755 --- a/crates/ec-ac3/src/stack_budget.rs +++ b/crates/ec-ac3/src/stack_budget.rs @@ -493,60 +493,6 @@ mod tests { ); } - /// The inventory, printed as a sorted table, and checked against the - /// types' real sizes. - /// - /// The print is the instrument: one command - /// (`cargo test -p ec-ac3 --lib -- stack_budget -- --nocapture`) - /// reproduces the whole table, biggest first, so "what is the largest - /// by-value type in this crate" has an answer that is a measurement - /// rather than a grep. - /// - /// The check reds on ANY change with both numbers. That is deliberate: a - /// by-value type that grew raises the question of whether it should have - /// been boxed instead, and auto-accepting the new number would answer - /// that question by default. - #[test] - fn the_measured_inventory_is_accurate() { - let live = measured_by_name(); - assert_eq!( - BY_VALUE_TYPES.len(), - live.len(), - "the inventory names {} types but {} are measured; every row needs \ - a measured size or the sweep is a list of hopes", - BY_VALUE_TYPES.len(), - live.len() - ); - let mut rows: Vec<(&str, usize)> = live.clone(); - rows.sort_by_key(|&(_, size)| std::cmp::Reverse(size)); - eprintln!( - "\nBY-VALUE INVENTORY ({} types, budget {STACK_BUDGET} B = {} KiB)", - rows.len(), - STACK_BUDGET / 1024 - ); - eprintln!("{:>8} {:>7} TYPE", "BYTES", "%BUDGET"); - for (name, size) in &rows { - eprintln!( - "{size:>8} {:>6.1}% {name}", - *size as f64 * 100.0 / STACK_BUDGET as f64 - ); - } - for (name, recorded, _public, _path) in BY_VALUE_TYPES { - let recorded = recorded.expect("every inventory row carries a measured size"); - let actual = live - .iter() - .find(|(n, _)| n == name) - .map(|(_, size)| *size) - .unwrap_or_else(|| panic!("{name} is inventoried but never measured")); - assert_eq!( - recorded, actual, - "{name} is {actual} bytes, the inventory records {recorded}; \ - update the table deliberately -- a by-value type that changed \ - is a stack cost every caller of its constructor now pays" - ); - } - } - /// The bound, asserted BY NAME. A regression in any inventoried type reds /// here naming the type, not "some type is too big". #[test] diff --git a/crates/ec-ac3/tests/it/real_library.rs b/crates/ec-ac3/tests/it/real_library.rs index cdda537e..ebdae6bf 100644 --- a/crates/ec-ac3/tests/it/real_library.rs +++ b/crates/ec-ac3/tests/it/real_library.rs @@ -30,11 +30,7 @@ fn reference(path: &Path) -> Vec { /// channel count. fn decode(path: &Path) -> (Vec, usize) { let data = std::fs::read(path).expect("fixture"); - let options = Options { - dither: false, - ..Options::default() - }; - let mut decoder = Ac3Decoder::with_options(options); + let mut decoder = Ac3Decoder::with_options(Options::default()); let (mut out, mut channels, mut pos) = (Vec::new(), 0, 0usize); while pos + 6 <= data.len() { if data[pos] != 0x0B || data[pos + 1] != 0x77 {