Skip to content

Conversation

Thalley
Copy link
Contributor

@Thalley Thalley commented Oct 2, 2025

Fixes a handful of incorrect string formats for some Bluetooth controller tests.

ll_length_req_send and ll_length_default_set were defined to return
a uint32_t, but only returned a uint8_t HCI error code and
was the return value was always stored as such.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley
Copy link
Contributor Author

Thalley commented Oct 2, 2025

An alternative I also considered was to cast PHY_1M, PHY_2M, PHY_CODED, etc. to uint8_t as they were always stored in uint8_t elsewhere.

A handful of Bluetooth controller tests were using %d for
non-int values. Some of the values were either uint64_t or
long unsigned ints.

In most cases, the types could be modified to uint8_t and
the formats changed to use %u.
In some macros, the types were just cast, as the values
would never be larger than uint8_t. The values in this case
were defined as e.g. BIT(0), BIT(1) and BIT(2) (which use the
UL type in the macro).

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley force-pushed the controller_test_format_fix branch from 3f61c7e to 23f94b9 Compare October 2, 2025 15:25
Copy link

sonarqubecloud bot commented Oct 2, 2025

@Thalley Thalley marked this pull request as ready for review October 2, 2025 16:23
@zephyrbot zephyrbot added area: Bluetooth area: Bluetooth Controller area: Tests Issues related to a particular existing or missing test labels Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller area: Bluetooth area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants