gstreamer-audio: Simplify audio clipping meta test a bit

This commit is contained in:
Sebastian Dröge 2020-04-11 19:36:06 +03:00
parent d05f8cace8
commit 7c19318097

View file

@ -74,6 +74,8 @@ mod tests {
#[test]
fn test_add_get_meta() {
use std::convert::TryInto;
gst::init().unwrap();
let mut buffer = gst::Buffer::with_size(1024).unwrap();
@ -85,24 +87,24 @@ mod tests {
gst::format::Default(Some(2)),
);
assert_eq!(
cmeta.get_start(),
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
cmeta.get_start().try_into(),
Ok(gst::format::Default(Some(1)))
);
assert_eq!(
cmeta.get_end(),
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
cmeta.get_end().try_into(),
Ok(gst::format::Default(Some(2)))
);
}
{
let cmeta = buffer.get_meta::<AudioClippingMeta>().unwrap();
assert_eq!(
cmeta.get_start(),
gst::GenericFormattedValue::Default(gst::format::Default(Some(1)))
cmeta.get_start().try_into(),
Ok(gst::format::Default(Some(1)))
);
assert_eq!(
cmeta.get_end(),
gst::GenericFormattedValue::Default(gst::format::Default(Some(2)))
cmeta.get_end().try_into(),
Ok(gst::format::Default(Some(2)))
);
}
}