Skip to content

Commit f28d007

Browse files
fix(tests): avoid relying on nan payload bits in stereo test (#25)
1 parent 6922e19 commit f28d007

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/dsp.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ mod tests {
592592
}
593593

594594
#[test]
595-
fn common_stereo_paths_preserve_general_fold_bits() {
595+
fn common_stereo_paths_match_general_fold() {
596596
for (samples, channels) in [
597597
(
598598
&[0.0, -0.0, f32::from_bits(0x7fc0_1234), f32::INFINITY][..],
@@ -621,7 +621,13 @@ mod tests {
621621
})
622622
});
623623
for (actual, expected) in block.stereo_frames().zip(expected) {
624-
assert_eq!(actual.map(f32::to_bits), expected.map(f32::to_bits));
624+
for (actual, expected) in actual.into_iter().zip(expected) {
625+
if expected.is_nan() {
626+
assert!(actual.is_nan());
627+
} else {
628+
assert_eq!(actual.to_bits(), expected.to_bits());
629+
}
630+
}
625631
}
626632
}
627633
}

0 commit comments

Comments
 (0)