forge
Explore
Log in

Don't you dare go Hollow

Let the cancel-walk test skip fixtures the video demuxer refuses

Browse files at this commit

4257e493257c287ca1e7af5c673560cd0c0aabb0Ahmet Kaan GümüşParent: 44547fa
  • test
    • let the cancel-walk test skip fixtures the video demuxer refuses
Show full message
🧪 test(engine): let the cancel-walk test skip fixtures the video demuxer refuses

The Matroska fixture sweep now also finds the audio-only test_ac3.mka,
which sorts first and which MkvDemuxer::open rightly refuses -- the test
panicked on its own expect before measuring anything. Take the first
fixture the video demuxer accepts, the shape the cue-index sweep below
already uses.
crates/engine/src/demux.rsmodified+6 -2
@@ -4201,12 +4201,16 @@ mod tests {
4201 /// about the file -- and the same walk without it still opens.4201 /// about the file -- and the same walk without it still opens.
4202 #[test]4202 #[test]
4203 fn a_cancelled_walk_gives_up_and_says_so() {4203 fn a_cancelled_walk_gives_up_and_says_so() {
4204- let Some(path) = matroska_fixtures().into_iter().next() else {4204+ // The first fixture the *video* demuxer accepts: the sweep also finds
4205+ // audio-only `.mka`, which `MkvDemuxer::open` rightly refuses.
4206+ let Some((path, lazy)) = matroska_fixtures()
4207+ .into_iter()
4208+ .find_map(|p| MkvDemuxer::open(&p).ok().map(|(_, lazy)| (p, lazy)))
4209+ else {
4205 eprintln!("no Matroska fixture: the cancel walk is not measured");4210 eprintln!("no Matroska fixture: the cancel walk is not measured");
4206 return;4211 return;
4207 };4212 };
4208 let name = path.file_name().unwrap().to_string_lossy().into_owned();4213 let name = path.file_name().unwrap().to_string_lossy().into_owned();
4209- let (_, lazy) = MkvDemuxer::open(&path).expect(&name);
4210 let (segment, number) = (lazy.segment, lazy.number);4214 let (segment, number) = (lazy.segment, lazy.number);
4211 let mut file = File::open(&path).expect(&name);4215 let mut file = File::open(&path).expect(&name);
4212 4216