MP4: Add a test for handling invalid atom types in Ilst

This commit is contained in:
Serial 2023-10-17 14:09:58 -04:00 committed by Alex
parent adc3b0ac9c
commit cab578de74
2 changed files with 14 additions and 0 deletions

View file

@ -1196,4 +1196,18 @@ mod tests {
// Meaning we only have 1 atom
assert_eq!(ilst.len(), 1);
}
#[test]
fn invalid_atom_type() {
let ilst = read_ilst("tests/tags/assets/ilst/invalid_atom_type.ilst");
// The tag contains 3 items, however the last one has an invalid type. We will stop at that point, but retain the
// first two items.
assert_eq!(ilst.len(), 2);
assert_eq!(ilst.track().unwrap(), 1);
assert_eq!(ilst.track_total().unwrap(), 0);
assert_eq!(ilst.disk().unwrap(), 1);
assert_eq!(ilst.disk_total().unwrap(), 2);
}
}

Binary file not shown.