SQA: Buzzer unit tests
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot, testing-qa
Research direction
Start by locating the buzzer driver and its test location, then read test_apogee_detect.c and other examples in the Flight-Computer-Firmware test or driver _test folders. Mock HAL_TIM_PWM_Start, HAL_Delay, and other calls used by buzzer_beep and buzzer_multi_beeps, then verify each function's calls, return status, and 100% line coverage.
Written by the indexing model from the issue text.
Description
Version: 2.7.0/2.8.0
Describe the feature you'd like
Write unit tests for the buzzer driver. This should test both buzzer_beep and buzzer_multi_beeps and achieve 100% line coverage for the two functions.
You'll need to make mock functions for the HAL calls like HAL_TIM_PWM_Start and HAL_Delay; see other tests for examples of how do this. You shouldn't get any linker errors after mocking all the function calls inside the functions you're testing, Then, call each function separately and use test asserts to check that the function performed as expected. For example, in the mock function for the HAL PWM start and stop, you can set a flag that confirms that the function was called. Then, check to make sure each flag was set after the test. Another simple test is to check to make sure the function returns what you expect (returns the expected BUZZ_STATUS)
You don't need to write a test for buzzer_num_beeps since that function is unused. If you want the coverage report to show 100% coverage, you can remove it.
Describe alternatives you've considered
N/A
Additional context
You can find other examples of unit tests in the Flight-Computer-Firmware test folder or in the driver _test folder. test_flight.c is a good example of a large, expansive test, but this task won't be nearly as big. test_apogee_detect.c is a good example of a simpler test.
Points of Contact
Firmware Lead: @NArmistead
sqa goat: @ETSells
- Dominant language
- C
- Stars
- 8
- Forks
- 6
- Avg merge
- 6d 15h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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.
More from SunDevilRocketry/Flight-Computer-Firmware
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
enhancement
SunDevilRocketry/Flight-Computer-Firmware#327 · 1 assignee ·
-
verification
Difficulty 4/5 3-5 days Newbie friendliness 45/100
SunDevilRocketry/Flight-Computer-Firmware#324 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
bug good first issue
SunDevilRocketry/Flight-Computer-Firmware#319 · 1 comment · 1 assignee ·
All issues in SunDevilRocketry/Flight-Computer-Firmware
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100