use super::*;
fn h265(line: &str) -> Box<dyn Fmtp> {
parse("video/H265", line)
}
#[test]
fn h265_formats_match_by_their_configuration_with_the_section_7_1_defaults() {
let none = h265("");
assert!(none.match_fmtp(&*h265(
"profile-space=0;profile-id=1;tier-flag=0;tx-mode=SRST"
)));
assert!(none.match_fmtp(&*h265(
"interop-constraints=B00000000000;profile-compatibility-indicator=40000000"
)));
assert!(h265("level-id=93").match_fmtp(&*h265("level-id=180")));
assert!(none.match_fmtp(&*h265("sprop-vps=QAEMAf//;sprop-max-don-diff=2")));
assert!(
!none.match_fmtp(&*h265("profile-id=2")),
"Main 10 is another format"
);
assert!(!none.match_fmtp(&*h265("tier-flag=1")));
assert!(!none.match_fmtp(&*h265("profile-space=1")));
assert!(!none.match_fmtp(&*h265("interop-constraints=000000000000")));
assert!(!none.match_fmtp(&*h265("profile-compatibility-indicator=60000000")));
assert!(
!none.match_fmtp(&*h265("tx-mode=MRST")),
"only SRST by default"
);
assert!(h265("tx-mode=mrst").match_fmtp(&*h265("tx-mode=MRST")));
assert!(
!h265("tx-mode=XYZ").match_fmtp(&*h265("tx-mode=XYZ")),
"not a mode"
);
}
#[test]
fn an_absent_h265_level_id_is_93() {
let fmtp = h265("");
let fmtp = fmtp.as_any().downcast_ref::<H265Fmtp>().expect("H.265");
assert_eq!(Some(93), fmtp.level_id());
assert_eq!(Some("SRST"), fmtp.tx_mode());
}