Skip to content

Commit

Permalink
tests: sensor: generic_test: Remove special-handling for axis values
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
ubieda authored and github-actions[bot] committed Jan 9, 2025
1 parent 82928c0 commit 334ea8e
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions tests/drivers/build_all/sensor/src/generic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,33 +216,8 @@ static void run_generic_test(const struct device *dev)
q31_t q;
int8_t shift;

switch (ch) {
/* Special handling to break out triplet samples. */
case SENSOR_CHAN_MAGN_X:
case SENSOR_CHAN_ACCEL_X:
case SENSOR_CHAN_GYRO_X:
q = decoded_data.three_axis.readings[0].x;
shift = decoded_data.three_axis.shift;
break;
case SENSOR_CHAN_MAGN_Y:
case SENSOR_CHAN_ACCEL_Y:
case SENSOR_CHAN_GYRO_Y:
q = decoded_data.three_axis.readings[0].y;
shift = decoded_data.three_axis.shift;
break;
case SENSOR_CHAN_MAGN_Z:
case SENSOR_CHAN_ACCEL_Z:
case SENSOR_CHAN_GYRO_Z:
q = decoded_data.three_axis.readings[0].z;
shift = decoded_data.three_axis.shift;
break;

/* Default case for single Q31 samples */
default:
q = decoded_data.q31.readings[0].value;
shift = decoded_data.q31.shift;
break;
}
q = decoded_data.q31.readings[0].value;
shift = decoded_data.q31.shift;

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

0 comments on commit 334ea8e

Please sign in to comment.