Skip to content

Commit 9c24c4a

Browse files
ubiedanashif
authored andcommitted
tests: sensor: generic_test: Remove special-handling for axis values
Since now they're treated as q31 values when individually queried, as opposed to lump them in a triplet. Signed-off-by: Luis Ubieda <[email protected]> (cherry picked from commit 19a4261)
1 parent 1443e29 commit 9c24c4a

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

tests/drivers/build_all/sensor/src/generic_test.c

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -216,33 +216,8 @@ static void run_generic_test(const struct device *dev)
216216
q31_t q;
217217
int8_t shift;
218218

219-
switch (ch) {
220-
/* Special handling to break out triplet samples. */
221-
case SENSOR_CHAN_MAGN_X:
222-
case SENSOR_CHAN_ACCEL_X:
223-
case SENSOR_CHAN_GYRO_X:
224-
q = decoded_data.three_axis.readings[0].x;
225-
shift = decoded_data.three_axis.shift;
226-
break;
227-
case SENSOR_CHAN_MAGN_Y:
228-
case SENSOR_CHAN_ACCEL_Y:
229-
case SENSOR_CHAN_GYRO_Y:
230-
q = decoded_data.three_axis.readings[0].y;
231-
shift = decoded_data.three_axis.shift;
232-
break;
233-
case SENSOR_CHAN_MAGN_Z:
234-
case SENSOR_CHAN_ACCEL_Z:
235-
case SENSOR_CHAN_GYRO_Z:
236-
q = decoded_data.three_axis.readings[0].z;
237-
shift = decoded_data.three_axis.shift;
238-
break;
239-
240-
/* Default case for single Q31 samples */
241-
default:
242-
q = decoded_data.q31.readings[0].value;
243-
shift = decoded_data.q31.shift;
244-
break;
245-
}
219+
q = decoded_data.q31.readings[0].value;
220+
shift = decoded_data.q31.shift;
246221

247222
/* Align everything to be a 64-bit Q32.32 number for comparison */
248223
int64_t expected_shifted =

0 commit comments

Comments
 (0)