From b8839e30b7194a082ce985527469cea0b5fee49e Mon Sep 17 00:00:00 2001 From: John Lettman Date: Tue, 13 Aug 2024 15:27:22 -0400 Subject: [PATCH] types/sensor_information: fix non-const in tests --- src/types/sensor_information.rs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/types/sensor_information.rs b/src/types/sensor_information.rs index 9cd723a..9001c04 100644 --- a/src/types/sensor_information.rs +++ b/src/types/sensor_information.rs @@ -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]