in cubeb-core/src/stream.rs [278:301]
fn stream_params_raw_format_native_endian() {
let mut raw: super::ffi::cubeb_stream_params = unsafe { mem::zeroed() };
raw.format = super::ffi::CUBEB_SAMPLE_S16NE;
let params = unsafe { StreamParamsRef::from_ptr(&mut raw) };
assert_eq!(
params.format(),
if cfg!(target_endian = "little") {
super::SampleFormat::S16LE
} else {
super::SampleFormat::S16BE
}
);
raw.format = super::ffi::CUBEB_SAMPLE_FLOAT32NE;
let params = unsafe { StreamParamsRef::from_ptr(&mut raw) };
assert_eq!(
params.format(),
if cfg!(target_endian = "little") {
super::SampleFormat::Float32LE
} else {
super::SampleFormat::Float32BE
}
);
}