SQA: Buzzer unit tests
@DanielB-2 ci sta già lavorando.
Dal 29/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- C
- Stelle
- 2
- Fork
- 0
- Merge medio
- 6g 17h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SunDevilRocketry/driver
-
USB: Add emulator support for usb_flushForse già presa @ETSells l’ha presa 13 giorni fa. Apertaenhancement
SunDevilRocketry/driver#62 · 2 commenti · 1 assegnatario ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
SunDevilRocketry/driver#61 ·
-
Cryptography: Add hardware-accelerated hashing supportForse già presa @acheon307 l’ha presa 13 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
SunDevilRocketry/driver#48 · 1 assegnatario ·
-
documentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
SunDevilRocketry/driver#46 ·
-
Mag: Write new magnetometer driver or wrapper for PID/vendor driverForse di nuovo libera @266-750Balloons l’ha presa 62 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
SunDevilRocketry/driver#40 · 5 commenti · 1 assegnatario ·
Tutte le issue di SunDevilRocketry/driver
Issue simili
-
luaebpf: the by-example page's intro names two outcomes of a lowering and omits the stop with the default verdictForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadocumentation severity: low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
luainkernel/lunatik#2231 ·
I maintainer di solito rispondono entro 1 giorno
-
aspect ratio 16:10Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Revivedx/SavageWindRecomp#402 ·
I maintainer di solito rispondono entro 1 giorno
-
cleanup help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ESPresense/ESPresense#2602 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/arrow-swift#209 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
libretiny-eu/libretiny#435 ·
I maintainer di solito rispondono entro 4 giorni