From df5fc6f82071f5eb2d28a9cedb2bd4e5133090b1 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 17 Oct 2018 15:55:42 +0200 Subject: Add dB test + long awaited README --- src/parsing/mod.rs | 2 ++ src/utils.rs | 13 +++++++++++++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/parsing/mod.rs b/src/parsing/mod.rs index 3aedb2c..4454b04 100644 --- a/src/parsing/mod.rs +++ b/src/parsing/mod.rs @@ -2,3 +2,5 @@ pub mod equalizer_apo; pub use self::equalizer_apo::MainParser as EqualizerApoParser; + +// TODO: test parsing filters with real examples diff --git a/src/utils.rs b/src/utils.rs index 24df0ce..b966a3b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -85,3 +85,16 @@ fn introspect(conn: &dbus::ConnPath<&Connection>) { println!("{}", thing.iter_init().read::().unwrap()); } */ + +#[cfg(test)] +mod tests { + + #[test] + fn decibel_to_ratio() { + assert_eq!(super::decibel_to_ratio(0f64), 1f64); + assert_eq!(super::decibel_to_ratio(20f64), 10f64); + assert_eq!(super::decibel_to_ratio(40f64), 100f64); + assert_eq!(super::decibel_to_ratio(60f64), 1000f64); + } + +} -- cgit v1.2.3