mirror of
https://github.com/RustAudio/rodio
synced 2024-12-14 06:02:31 +00:00
SampleRateConverter::test: Minor refactor
This commit is contained in:
parent
b996697e93
commit
c5147cea07
1 changed files with 8 additions and 8 deletions
|
@ -268,9 +268,9 @@ mod test {
|
||||||
|
|
||||||
let input: Vec<u16> = Vec::new();
|
let input: Vec<u16> = Vec::new();
|
||||||
let output =
|
let output =
|
||||||
SampleRateConverter::new(input.into_iter(), from, to, n);
|
SampleRateConverter::new(input.into_iter(), from, to, n)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let output = output.collect::<Vec<_>>();
|
|
||||||
assert_eq!(output, []);
|
assert_eq!(output, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,9 +279,9 @@ mod test {
|
||||||
if n == 0 { return; }
|
if n == 0 { return; }
|
||||||
|
|
||||||
let output =
|
let output =
|
||||||
SampleRateConverter::new(input.clone().into_iter(), from, from, n);
|
SampleRateConverter::new(input.clone().into_iter(), from, from, n)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let output = output.collect::<Vec<_>>();
|
|
||||||
assert_eq!(input, output);
|
assert_eq!(input, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,9 +291,9 @@ mod test {
|
||||||
|
|
||||||
let input = vec![1u16, 16, 2, 17, 3, 18, 4, 19, 5, 20, 6, 21];
|
let input = vec![1u16, 16, 2, 17, 3, 18, 4, 19, 5, 20, 6, 21];
|
||||||
let output =
|
let output =
|
||||||
SampleRateConverter::new(input.into_iter(), from, to, 2);
|
SampleRateConverter::new(input.clone().into_iter(), from, to, n)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let output = output.collect::<Vec<_>>();
|
|
||||||
assert_eq!(output, [1, 16, 3, 18, 5, 20]);
|
assert_eq!(output, [1, 16, 3, 18, 5, 20]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,9 +303,9 @@ mod test {
|
||||||
|
|
||||||
let input = vec![2u16, 16, 4, 18, 6, 20, 8, 22];
|
let input = vec![2u16, 16, 4, 18, 6, 20, 8, 22];
|
||||||
let output =
|
let output =
|
||||||
SampleRateConverter::new(input.into_iter(), from, to, 2);
|
SampleRateConverter::new(input.into_iter(), from, to, 2)
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let output = output.collect::<Vec<_>>();
|
|
||||||
assert_eq!(output, [2, 16, 3, 17, 4, 18, 5, 19, 6, 20, 7, 21, 8, 22]);
|
assert_eq!(output, [2, 16, 3, 17, 4, 18, 5, 19, 6, 20, 7, 21, 8, 22]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue