summaryrefslogtreecommitdiffstats
path: root/src/conversion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversion.rs')
-rw-r--r--src/conversion.rs13
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>>) {