diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-30 13:36:06 +0200 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-31 13:41:26 +0200 |
commit | 50223ad02e2f487540107e320c8bef40a9849582 (patch) | |
tree | 58b4e44e2261940d07aba96b8d8e83457e641f53 /src/conversion.rs | |
parent | ab1221e175f2da577c7a3fb510b5ae5cf41b0697 (diff) | |
download | ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.gz ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.xz ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.zip |
Format code
Diffstat (limited to 'src/conversion.rs')
-rw-r--r-- | src/conversion.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/conversion.rs b/src/conversion.rs index fef80ac..2be9f1e 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -44,25 +44,24 @@ impl ConvertMeasurement for ic::Resolution16Bit { } } - #[cfg(test)] mod tests { use super::*; #[test] fn convert_measurement_12_bits() { - assert_eq!( 0, ic::Resolution12Bit::convert_measurement(0)); - assert_eq!( 2047, ic::Resolution12Bit::convert_measurement(0x7FFF)); + assert_eq!(0, ic::Resolution12Bit::convert_measurement(0)); + assert_eq!(2047, ic::Resolution12Bit::convert_measurement(0x7FFF)); assert_eq!(-2048, ic::Resolution12Bit::convert_measurement(0x8000)); - assert_eq!( -1, ic::Resolution12Bit::convert_measurement(0xFFFF)); + assert_eq!(-1, ic::Resolution12Bit::convert_measurement(0xFFFF)); } #[test] fn convert_measurement_16_bits() { - assert_eq!( 0, ic::Resolution16Bit::convert_measurement(0)); - assert_eq!( 32767, ic::Resolution16Bit::convert_measurement(0x7FFF)); + assert_eq!(0, ic::Resolution16Bit::convert_measurement(0)); + assert_eq!(32767, ic::Resolution16Bit::convert_measurement(0x7FFF)); assert_eq!(-32768, ic::Resolution16Bit::convert_measurement(0x8000)); - assert_eq!( -1, ic::Resolution16Bit::convert_measurement(0xFFFF)); + assert_eq!(-1, ic::Resolution16Bit::convert_measurement(0xFFFF)); } fn assert_invalid_input_data<E>(result: Result<u16, Error<E>>) { |