Skip to content

Commit

Permalink
removes symphonia duration unit tests
Browse files Browse the repository at this point in the history
In principle we do not have unit tests. See contributor guidlines for
the reasoning.
  • Loading branch information
dvdsk committed Nov 27, 2024
1 parent 8f45194 commit de0ffdc
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/decoder/symphonia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,48 +341,3 @@ impl Iterator for SymphoniaDecoder {
Some(sample)
}
}

#[cfg(test)]
mod tests {
use std::time::Duration;

use symphonia::core::units::Time;

use crate::decoder::symphonia::time_to_duration;

#[test]
fn test_time_to_dur_zero_frac() {
let time = Time {
seconds: 7,
frac: 0.0,
};
let duration = Duration::new(
time.seconds,
if time.frac > 0.0 {
(1f64 / time.frac) as u32
} else {
0
},
);

assert_eq!(time_to_duration(time), duration);
}

#[test]
fn test_time_to_dur_non_zero_frac() {
let time = Time {
seconds: 7,
frac: 0.3,
};
let duration = Duration::new(
time.seconds,
if time.frac > 0.0 {
(1f64 / time.frac) as u32
} else {
0
},
);

assert_eq!(time_to_duration(time), duration);
}
}

0 comments on commit de0ffdc

Please sign in to comment.