From 3c574b3519086f3471055dab97fd94459de5b8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 3 Jun 2021 19:24:25 +0200 Subject: [PATCH] pll: update tests and benches --- dsp/benches/micro.rs | 4 ++-- dsp/src/pll.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dsp/benches/micro.rs b/dsp/benches/micro.rs index c3588df..a449339 100644 --- a/dsp/benches/micro.rs +++ b/dsp/benches/micro.rs @@ -44,11 +44,11 @@ fn pll_bench() { let mut dut = PLL::default(); println!( "PLL::update(t, 12, 12): {}", - bench_env(0x241, |x| dut.update(*x, 12, 12)) + bench_env(Some(0x241), |x| dut.update(*x, 12, 12)) ); println!( "PLL::update(t, sf, sp): {}", - bench_env((0x241, 21, 20), |(x, p, q)| dut.update(*x, *p, *q)) + bench_env((Some(0x241), 21, 20), |(x, p, q)| dut.update(*x, *p, *q)) ); } diff --git a/dsp/src/pll.rs b/dsp/src/pll.rs index 09a5464..1c6a782 100644 --- a/dsp/src/pll.rs +++ b/dsp/src/pll.rs @@ -91,7 +91,7 @@ mod tests { #[test] fn mini() { let mut p = PLL::default(); - let (y, f) = p.update(0x10000, 8, 4); + let (y, f) = p.update(Some(0x10000), 8, 4); assert_eq!(y, 0x1100); assert_eq!(f, y); } @@ -105,7 +105,7 @@ mod tests { let mut x = 0i32; for i in 0..n { x = x.wrapping_add(f0); - let (y, f) = p.update(x, shift.0, shift.1); + let (y, f) = p.update(Some(x), shift.0, shift.1); if i > n / 4 { assert_eq!(f.wrapping_sub(f0).abs() <= 1, true); }