use super::*;
use bytes::Bytes;
#[test]
fn three_reference_indices_are_accepted() -> Result<()> {
let mut packet = Vp9Packet::default();
let payload = packet.depacketize(&Bytes::from_static(&[0xD0, 0x02, 0x03, 0x05, 0x06, 0xAA]))?;
assert_eq!(vec![1, 2, 3], packet.pdiff);
assert_eq!(&[0xAA], &payload[..]);
Ok(())
}
#[test]
fn reserved_bits_of_the_ss_header_are_not_the_g_bit() -> Result<()> {
let mut packet = Vp9Packet::default();
packet.depacketize(&Bytes::from_static(&[0x0E, 0x07, 0xAA]))?;
assert!(packet.v);
assert!(!packet.g, "the reserved bits must not read as G");
assert_eq!(0, packet.ng);
Ok(())
}
#[test]
fn the_g_bit_announces_a_picture_group() -> Result<()> {
let mut packet = Vp9Packet::default();
packet.depacketize(&Bytes::from_static(&[0x0E, 0x08, 0x01, 0x04, 0x01, 0xAA]))?;
assert!(packet.g);
assert_eq!(1, packet.ng);
assert_eq!(vec![vec![1u8]], packet.pgpdiff);
Ok(())
}