mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 14:44:22 +00:00
MP4: Add a test for handling invalid atom types in Ilst
This commit is contained in:
parent
adc3b0ac9c
commit
cab578de74
2 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
BIN
tests/tags/assets/ilst/invalid_atom_type.ilst
Normal file
BIN
tests/tags/assets/ilst/invalid_atom_type.ilst
Normal file
Binary file not shown.
Loading…
Reference in a new issue