forge
Explore
Log in

Don't you dare go Hollow

vp9kf: scratch_synth skips when its tmpfs fixture is gone

Browse files at this commit

2a10cb5ab5152ac7283e1e96ee6f65a9e25a398dAhmet Kaan GümüşParent: fcfe947
The probe parses /tmp/synth-kf-frame.bin, a dump produced ad hoc in an
earlier session with no recorded generator. With tmpfs wiped it panicked,
which made a scratch harness look like a regression in every workspace run.
Print a SKIP line instead; the probe still runs whenever the dump exists.
crates/ec-vp9/tests/scratch_synth.rsmodified+13 -2
@@ -1,10 +1,21 @@
1+//! [scratch] Parse a synthetic keyframe header dump.
2+//!
3+//! The dump was produced ad hoc in an earlier session and lives in tmpfs
4+//! (`/tmp/synth-kf-frame.bin`), so the test skips - loudly - when it is gone:
5+//! a missing tmpfs fixture is not a regression.
1 use ec_vp9_syntax::Vp9Parser;6 use ec_vp9_syntax::Vp9Parser;
2 #[test]7 #[test]
3 fn synth() {8 fn synth() {
4- let frame = std::fs::read("/tmp/synth-kf-frame.bin").unwrap();9+ let Ok(frame) = std::fs::read("/tmp/synth-kf-frame.bin") else {
10+ println!("SKIP: /tmp/synth-kf-frame.bin absent (tmpfs fixture)");
11+ return;
12+ };
5 let mut p = Vp9Parser::new();13 let mut p = Vp9Parser::new();
6 match p.parse_frame(&frame) {14 match p.parse_frame(&frame) {
7- Ok(h) => println!("w={} h={} uhs={} hsib={}", h.width, h.height, h.uncompressed_header_size, h.header_size_in_bytes),15+ Ok(h) => println!(
16+ "w={} h={} uhs={} hsib={}",
17+ h.width, h.height, h.uncompressed_header_size, h.header_size_in_bytes
18+ ),
8 Err(e) => println!("ERR {e}"),19 Err(e) => println!("ERR {e}"),
9 }20 }
10 }21 }