Skip to content

Commit

Permalink
types/sensor_information: fix non-const in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlettman committed Aug 13, 2024
1 parent c1804a7 commit b8839e3
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/types/sensor_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,26 @@ mod tests {

const BINARY_ENDIAN: Endian = Endian::NATIVE;
const BINARY_CASES: [(SensorInformation, [u8; 1]); 5] = [
(SensorInformation::new(true, true, true), [0b0000_0111]),
(SensorInformation::new(true, true, false), [0b0000_0110]),
(SensorInformation::new(true, false, true), [0b0000_0101]),
(SensorInformation::new(false, true, true), [0b0000_0111]),
(SensorInformation::new(false, false, false), [0b0000_0111]),
(
SensorInformation { pitch_valid: true, roll_valid: true, distance_valid: true },
[0b0000_0111],
),
(
SensorInformation { pitch_valid: true, roll_valid: true, distance_valid: false },
[0b0000_0110],
),
(
SensorInformation { pitch_valid: true, roll_valid: false, distance_valid: true },
[0b0000_0101],
),
(
SensorInformation { pitch_valid: false, roll_valid: true, distance_valid: true },
[0b0000_0111],
),
(
SensorInformation { pitch_valid: false, roll_valid: false, distance_valid: false },
[0b0000_0111],
),
];

#[test]
Expand Down

0 comments on commit b8839e3

Please sign in to comment.