fix tests
run with `cargo test --target=x86_64-unknown-linux-gnu`
This commit is contained in:
parent
94e0525002
commit
fb81380955
@ -461,7 +461,7 @@ mod test {
|
||||
assert_eq!(command, Ok(Command::Pwm {
|
||||
channel: 1,
|
||||
pin: PwmPin::ISet,
|
||||
value: 16383,
|
||||
value: 16383.0,
|
||||
}));
|
||||
}
|
||||
|
||||
@ -470,7 +470,6 @@ mod test {
|
||||
let command = Command::parse(b"pwm 0 pid");
|
||||
assert_eq!(command, Ok(Command::PwmPid {
|
||||
channel: 0,
|
||||
pin: PwmPin::ISet,
|
||||
}));
|
||||
}
|
||||
|
||||
@ -480,7 +479,7 @@ mod test {
|
||||
assert_eq!(command, Ok(Command::Pwm {
|
||||
channel: 0,
|
||||
pin: PwmPin::MaxIPos,
|
||||
value: 7,
|
||||
value: 7.0,
|
||||
}));
|
||||
}
|
||||
|
||||
@ -490,7 +489,7 @@ mod test {
|
||||
assert_eq!(command, Ok(Command::Pwm {
|
||||
channel: 0,
|
||||
pin: PwmPin::MaxINeg,
|
||||
value: 128,
|
||||
value: 128.0,
|
||||
}));
|
||||
}
|
||||
|
||||
@ -500,7 +499,7 @@ mod test {
|
||||
assert_eq!(command, Ok(Command::Pwm {
|
||||
channel: 0,
|
||||
pin: PwmPin::MaxV,
|
||||
value: 32768,
|
||||
value: 32768.0,
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![cfg_attr(not(test), no_std)]
|
||||
#![cfg_attr(not(test), no_main)]
|
||||
#![feature(maybe_uninit_extra, maybe_uninit_ref)]
|
||||
// TODO: #![deny(warnings, unused)]
|
||||
|
||||
#[cfg(not(feature = "semihosting"))]
|
||||
#[cfg(not(any(feature = "semihosting", test)))]
|
||||
use panic_abort as _;
|
||||
#[cfg(feature = "semihosting")]
|
||||
#[cfg(any(feature = "semihosting", not(test)))]
|
||||
use panic_semihosting as _;
|
||||
|
||||
use log::{info, warn};
|
||||
@ -80,6 +80,7 @@ const TCP_PORT: u16 = 23;
|
||||
|
||||
|
||||
/// Initialization and main loop
|
||||
#[cfg(not(test))]
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
init_log();
|
||||
|
@ -103,7 +103,7 @@ mod test {
|
||||
const DELAY: usize = 10;
|
||||
|
||||
let mut pid = Controller::new(PARAMETERS.clone());
|
||||
pid.set_target(TARGET);
|
||||
pid.target = TARGET;
|
||||
|
||||
let mut values = [DEFAULT; DELAY];
|
||||
let mut t = 0;
|
||||
@ -118,6 +118,5 @@ mod test {
|
||||
t = next_t;
|
||||
total_t += 1;
|
||||
}
|
||||
dbg!(values[t], total_t);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user