Remove accidentally copied tests
This commit is contained in:
parent
36d54edae7
commit
26c503d862
|
@ -245,70 +245,3 @@ impl<'slice, 'sample> ChannelSamples<'slice, 'sample> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(miri, test))]
|
|
||||||
mod miri {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn repeated_access() {
|
|
||||||
let mut real_buffers = vec![vec![0.0; 512]; 2];
|
|
||||||
let mut buffer = Buffer::default();
|
|
||||||
unsafe {
|
|
||||||
buffer.with_raw_vec(|output_slices| {
|
|
||||||
let (first_channel, other_channels) = real_buffers.split_at_mut(1);
|
|
||||||
*output_slices = vec![&mut first_channel[0], &mut other_channels[0]];
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
for samples in buffer.iter_samples() {
|
|
||||||
for sample in samples {
|
|
||||||
*sample += 0.001;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for mut samples in buffer.iter_samples() {
|
|
||||||
for _ in 0..2 {
|
|
||||||
for sample in samples.iter_mut() {
|
|
||||||
*sample += 0.001;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_eq!(real_buffers[0][0], 0.003);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn repeated_slices() {
|
|
||||||
let mut real_buffers = vec![vec![0.0; 512]; 2];
|
|
||||||
let mut buffer = Buffer::default();
|
|
||||||
unsafe {
|
|
||||||
buffer.with_raw_vec(|output_slices| {
|
|
||||||
let (first_channel, other_channels) = real_buffers.split_at_mut(1);
|
|
||||||
*output_slices = vec![&mut first_channel[0], &mut other_channels[0]];
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
// These iterators should not alias
|
|
||||||
let mut blocks = buffer.iter_blocks(16);
|
|
||||||
let (_block1_offset, block1) = blocks.next().unwrap();
|
|
||||||
let (_block2_offset, block2) = blocks.next().unwrap();
|
|
||||||
for channel in block1 {
|
|
||||||
for sample in channel.iter_mut() {
|
|
||||||
*sample += 0.001;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for channel in block2 {
|
|
||||||
for sample in channel.iter_mut() {
|
|
||||||
*sample += 0.001;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for i in 0..32 {
|
|
||||||
assert_eq!(real_buffers[0][i], 0.001);
|
|
||||||
}
|
|
||||||
for i in 32..48 {
|
|
||||||
assert_eq!(real_buffers[0][i], 0.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue