MP4: Add test for empty ilst

This commit is contained in:
Serial 2022-07-05 22:38:55 -04:00
parent e1c10bee66
commit e245155f99
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
3 changed files with 21 additions and 0 deletions

View file

@ -169,6 +169,8 @@
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// TODO: Give 1.62.0 some time, and start using #[default] on enums
pub mod ape;
pub mod error;
pub(crate) mod file;

View file

@ -167,3 +167,22 @@ where
},
}
}
#[cfg(test)]
mod tests {
use crate::mp4::{Ilst, Mp4File};
use crate::tag::utils::test_utils;
use crate::AudioFile;
use std::io::Cursor;
#[test]
fn zero_sized_ilst() {
let file = Mp4File::read_from(
&mut Cursor::new(test_utils::read_path("tests/files/assets/zero/zero.ilst")),
false,
)
.unwrap();
assert_eq!(file.ilst, Some(Ilst::default()));
}
}

Binary file not shown.