----------------------------------------
-----------Sun Devil Rocketry-----------
-----------Unit Test Results------------
----------------------------------------

----------------------------------------
------------Test Environment------------
----------------------------------------

--General Build Information--
Test Name:        fsm_appa
Test Type:        Unit Test
Build Date:       Oct 10 2026
Build Time:       23:25:21
Run Date:         Oct 10 2026
Run Time:         23:25:21
ISO C?:           1
C Standard:       201710

--GNU C Compiler (GCC) Info--
GCC Version:      13.3.0

--GCOVR Info--
GCOVR Version:    8.6

----------------------------------------
----------------Results-----------------
----------------------------------------


--BEGIN TEST GROUP: Check test environment--

Test Environment: Release build
Actual: TRUE | Expected: TRUE

Test Environment: ISO C standard is C17 or greater
Actual: 201710 | Expected: 201700

Test Environment: Compiler at/above minimum GCC version
Actual: 13 | Expected: 8

Test Environment: Compiler at/below maximum GCC version
Actual: 13 | Expected: 15

Test Environment: Coverage tool at/above minimum GCOVR version
Actual: 8 | Expected: 7

Test Environment: Coverage tool at/below maximum GCOVR version
Actual: 8 | Expected: 8

--TEST GROUP RESULTS:--
Group Passes: 6
Group Fails:  0
--END TEST GROUP: Check test environment--


--BEGIN TEST GROUP: FSM: State Update Function--

-> BEGIN TEST CASE 0: Normal: Sequential forward transition (INIT->IDLE)

Test that state was updated correctly.
Actual: 1 | Expected: 1

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 1: Normal: Sequential forward transition (IDLE->CALIB)

Test that state was updated correctly.
Actual: 2 | Expected: 2

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 2: Normal: Same state transition (IDLE->IDLE)

Test that state was updated correctly.
Actual: 1 | Expected: 1

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 3: Normal: Sequential forward transition (CALIB->LAUNCH_DETECT)

Test that state was updated correctly.
Actual: 3 | Expected: 3

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 4: Normal: Sequential forward transition (LAUNCH_DETECT->FLIGHT)

Test that state was updated correctly.
Actual: 4 | Expected: 4

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 5: Normal: Sequential forward transition (FLIGHT->POST_APOGEE)

Test that state was updated correctly.
Actual: 6 | Expected: 6

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 6: Normal: Sequential forward transition (POST_APOGEE->DEPLOYED)

Test that state was updated correctly.
Actual: 7 | Expected: 7

Test that no error was triggered.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 7: Error: Skip states (INIT->CALIB)

Test that error was triggered.
Actual: 56 | Expected: 56

-> END TEST CASE

-> BEGIN TEST CASE 8: Error: Skip states (IDLE->LAUNCH_DETECT)

Test that error was triggered.
Actual: 56 | Expected: 56

-> END TEST CASE

-> BEGIN TEST CASE 9: Error: Backward transition (CALIB->IDLE)

Test that error was triggered.
Actual: 56 | Expected: 56

-> END TEST CASE

-> BEGIN TEST CASE 10: Error: Backward transition (FLIGHT->LAUNCH_DETECT)

Test that error was triggered.
Actual: 56 | Expected: 56

-> END TEST CASE

-> BEGIN TEST CASE 11: Error: Jump to DEPLOYED from INIT

Test that error was triggered.
Actual: 56 | Expected: 56

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 19
Group Fails:  0
--END TEST GROUP: FSM: State Update Function--


--BEGIN TEST GROUP: FSM: State Getter Function--

-> BEGIN TEST CASE 0: Get state: INIT

Test that correct state was returned.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 1: Get state: IDLE

Test that correct state was returned.
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 2: Get state: CALIB

Test that correct state was returned.
Actual: 2 | Expected: 2

-> END TEST CASE

-> BEGIN TEST CASE 3: Get state: LAUNCH_DETECT

Test that correct state was returned.
Actual: 3 | Expected: 3

-> END TEST CASE

-> BEGIN TEST CASE 4: Get state: FLIGHT

Test that correct state was returned.
Actual: 4 | Expected: 4

-> END TEST CASE

-> BEGIN TEST CASE 5: Get state: POST_APOGEE

Test that correct state was returned.
Actual: 6 | Expected: 6

-> END TEST CASE

-> BEGIN TEST CASE 6: Get state: DEPLOYED

Test that correct state was returned.
Actual: 7 | Expected: 7

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 7
Group Fails:  0
--END TEST GROUP: FSM: State Getter Function--


--BEGIN TEST GROUP: FSM: Entry and Initialization--

-> BEGIN TEST CASE 0: Normal: Preset found

Test that LED was set correct number of times.
Actual: 1 | Expected: 1

Test that buzzer multi-beeps was called correct number of times.
Actual: 1 | Expected: 1

Test that motor drive was called correct number of times.
Actual: 4 | Expected: 4

Test that sensor start was called.
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 1: Warning: Preset not found

Test that LED was set correct number of times.
Actual: 2 | Expected: 2

Test that buzzer multi-beeps was called correct number of times.
Actual: 2 | Expected: 2

Test that motor drive was called correct number of times.
Actual: 4 | Expected: 4

Test that sensor start was called.
Actual: 1 | Expected: 1

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 8
Group Fails:  0
--END TEST GROUP: FSM: Entry and Initialization--


--BEGIN TEST GROUP: FSM: IDLE State Behavior--

-> BEGIN TEST CASE 0: Normal: USB OK, stay in IDLE

Test that prelaunch terminal was called.
Actual: 1 | Expected: 1

Test that no error occurred.
Actual: -1 | Expected: -1

-> END TEST CASE

-> BEGIN TEST CASE 1: Error: USB FAIL triggers error

Test that USB error was handled.
Actual: 25 | Expected: 25

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 3
Group Fails:  0
--END TEST GROUP: FSM: IDLE State Behavior--


--BEGIN TEST GROUP: FSM: While Loop Coverage--

-> BEGIN TEST CASE 0: FSM while-loop and switch full coverage

Expected case executed exactly once
Actual: 1 | Expected: 1

Expected case executed exactly once
Actual: 1 | Expected: 1

Expected case executed exactly once
Actual: 1 | Expected: 1

Expected case executed exactly once
Actual: 1 | Expected: 1

Expected case executed exactly once
Actual: 1 | Expected: 1

Expected case executed exactly once
Actual: 1 | Expected: 1

INIT case executed
Actual: 1 | Expected: 1

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 7
Group Fails:  0
--END TEST GROUP: FSM: While Loop Coverage--


--BEGIN TEST GROUP: FSM: USB Fail Inside Loop--

-> BEGIN TEST CASE 0: USB_FAIL triggers error inside FSM loop

USB error triggered
Actual: 25 | Expected: 25

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 1
Group Fails:  0
--END TEST GROUP: FSM: USB Fail Inside Loop--


--BEGIN TEST GROUP: FSM: State Transitions--

-> BEGIN TEST CASE 0: State: INIT transitions to IDLE

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 1: State: IDLE runs prelaunch

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 2: State: CALIB runs calibration

Test that flight_calib was called correct number of times.
Actual: 1 | Expected: 1

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 3: State: LAUNCH_DETECT runs launch detect

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 1 | Expected: 1

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 4: State: FLIGHT runs in_flight

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 1 | Expected: 1

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 5: State: POST_APOGEE runs deploy

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_deploy was called correct number of times.
Actual: 1 | Expected: 1

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 6: State: DEPLOYED runs descent

Test that flight_calib was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_launch_detect was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_in_flight was called correct number of times.
Actual: 1 | Expected: 1

Test that flight_deploy was called correct number of times.
Actual: 0 | Expected: 0

Test that flight_descent was called correct number of times.
Actual: 0 | Expected: 0

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 35
Group Fails:  0
--END TEST GROUP: FSM: State Transitions--


--BEGIN TEST GROUP: FSM: Calibration to Launch Detect--

-> BEGIN TEST CASE 0: Calibration implicitly transitions to launch detect

Test that flight_calib was called.
Actual: 1 | Expected: 1

Test that buzzer beeped after calib.
Actual: 1 | Expected: 1

Test that HAL_GetTick was called for launch_detect_start_time.
Actual: 1 | Expected: 1

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 3
Group Fails:  0
--END TEST GROUP: FSM: Calibration to Launch Detect--


--BEGIN TEST GROUP: FSM: Complete Mission Profile--

-> BEGIN TEST CASE 0: Complete mission profile: INIT->IDLE->...->DEPLOYED

Test INIT->IDLE transition.
Actual: 1 | Expected: 1

Test IDLE->CALIB transition.
Actual: 2 | Expected: 2

Test CALIB->LAUNCH_DETECT transition.
Actual: 3 | Expected: 3

Test LAUNCH_DETECT->FLIGHT transition.
Actual: 4 | Expected: 4

Test FLIGHT->POST_APOGEE transition.
Actual: 6 | Expected: 6

Test POST_APOGEE->DEPLOYED transition.
Actual: 7 | Expected: 7

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 6
Group Fails:  0
--END TEST GROUP: FSM: Complete Mission Profile--

----------------------------------------
-------------Test Complete--------------
----------------------------------------
Passes: 95
Fails:  0
Result: PASS
----------------------------------------
