[I2C] Code clean up for i2c_host_tx_rx_test.c
Open
Nobody has claimed this yet.
Component:ChipLevelTest
Earlgrey-PROD Candidate
IP:i2c
Priority:P4
Type:Cleanup
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
Description
Per discussion in #16972 the code for the i2c host test can be improved by:
- Utilizing function
i2c_testutils_connect_i2c_to_pinmux_pins - Using anonymous enum instead of a magic number
- Using an array of structs to simplify switch statements
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with i2c_host_tx_rx_test.c and review the discussion in issue #16972, then inspect how i2c_testutils_connect_i2c_to_pinmux_pins is used elsewhere. The cleanup is complete when the test uses that helper, replaces the magic number with an anonymous enum, and uses an array of structs instead of the switch statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, testing-qa
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100