Skip to content

Commit

Permalink
test3_float16: Fix big-endian logic in the _decode test
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Rønningstad <[email protected]>
  • Loading branch information
oyvindronningstad committed Nov 27, 2023
1 parent 89a9d0f commit 4047a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/unit/test3_float16/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ ZTEST(zcbor_unit_tests3, test_float16_decode)
zassert_true(zcbor_float16_put(state_e, out));


uint16_t payload_ne = *(uint16_t *)&payload[1];
#ifndef ZCBOR_BIG_ENDIAN
uint16_t payload_ne = switch_bytes(*(uint16_t *)&payload[1]);
payload_ne = switch_bytes(payload_ne);
#endif

if (isnan(fps[i])) {
Expand Down

0 comments on commit 4047a86

Please sign in to comment.