Add a test for 'packet loss' decode calls

Tests 06643a44.
This commit is contained in:
Tad Hardesty 2018-08-07 02:26:50 -07:00
parent f43fcc33ad
commit 5600b95aa4
No known key found for this signature in database
GPG Key ID: AEFCC915C75ACC47

13
tests/fec.rs Normal file
View File

@ -0,0 +1,13 @@
//! Test that supplying empty packets does forward error correction.
extern crate opus;
use opus::*;
#[test]
fn blah() {
let mut opus = Decoder::new(48000, Channels::Mono).unwrap();
let mut output = vec![0i16; 5760];
let size = opus.decode(&[], &mut output[..], true).unwrap();
assert_eq!(size, 5760);
}