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

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

--General Build Information--
Test Name:        flight
Test Type:        Unit Test
Build Date:       Oct 10 2026
Build Time:       23:25:54
Run Date:         Oct 10 2026
Run Time:         23:25:54
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: Flight Loop: Sensor Calibration--

Test that GPS was enabled.
Actual: 1 | Expected: 1

Test that TX mode was enabled.
Actual: 16 | Expected: 16

Test that GPS was disabled.
Actual: 0 | Expected: 0

Test that LoRa was disabled.
Actual: 0 | Expected: 0

--TEST GROUP RESULTS:--
Group Passes: 4
Group Fails:  0
--END TEST GROUP: Flight Loop: Sensor Calibration--


--BEGIN TEST GROUP: Flight Loop: Launch Detect--

-> BEGIN TEST CASE 0: Normal: Typical operation, launch not detected.

Test that the state has remained constant.
Actual: 3 | Expected: 3

Test that flash was not erased (preserving presets).
Actual: 0 | Expected: 0

Test that the timer was not reset.
Actual: 200 | Expected: 200

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 1: Normal: Typical operation, launch detected.

Test that the state has been advanced.
Actual: 4 | Expected: 4

Test that flash was not erased (preserving presets).
Actual: 0 | Expected: 0

Test that the timer was not reset.
Actual: 200 | Expected: 200

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 2: Normal: Timeout, launch not detected.

Test that the state has remained constant.
Actual: 3 | Expected: 3

Test that flash was erased (preserving presets).
Actual: 1 | Expected: 1

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that the timer was reset.
Actual: 5001 | Expected: 5001

-> END TEST CASE

-> BEGIN TEST CASE 3: Robust: Timeout, flash fail

Test that the state has remained constant.
Actual: 3 | Expected: 3

Test that flash was not erased (preserving presets).
Actual: 0 | Expected: 0

Test that the timer was reset.
Actual: 5001 | Expected: 5001

-> END TEST CASE

-> BEGIN TEST CASE 4: Robust: Flash busy 2x, launch not detected.

Test that the state has remained constant.
Actual: 3 | Expected: 3

Test that flash was not erased (preserving presets).
Actual: 0 | Expected: 0

Test that the timer was not reset.
Actual: 200 | Expected: 200

Test that control was stuck in the flash busy loop correctly.
Actual: 3 | Expected: 3

-> END TEST CASE

-> BEGIN TEST CASE 5: Robust: Timeout + Flash busy 2x, launch not detected.

Test that the state has remained constant.
Actual: 3 | Expected: 3

Test that flash was erased (preserving presets).
Actual: 1 | Expected: 1

Test that control was stuck in the flash busy loop correctly.
Actual: 3 | Expected: 3

Test that the timer was reset.
Actual: 5001 | Expected: 5001

-> END TEST CASE

-> BEGIN TEST CASE 6: Robust: Sensor fail

Test that the sensor command error was handled correctly.
Actual: 36 | Expected: 36

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 24
Group Fails:  0
--END TEST GROUP: Flight Loop: Launch Detect--


--BEGIN TEST GROUP: Flight Loop: Ascent (in_flight)--

-> BEGIN TEST CASE 0: Normal: Typical operation, coast & apogee not detected.

Test that the state has remained constant.
Actual: 4 | Expected: 4

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 1: Normal: Typical operation, coast not detected and apogee detected.

Test that the state has been advanced to apogee.
Actual: 6 | Expected: 6

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 2: Normal: Typical operation, coast detected and apogee not detected.

Test that the state has been advanced to coast.
Actual: 5 | Expected: 5

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 3: Normal: Typical operation, coast detected and apogee detected.

Test that the state has been advanced to coast.
Actual: 5 | Expected: 5

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 4: Normal: Active roll not configured, apogee not detected.

Test that the state has remained constant.
Actual: 4 | Expected: 4

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control wasn't entered
Actual (address): 0xb501b95c | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 5: Normal: Flash full, apogee not detected.

Test that the state has remained constant.
Actual: 4 | Expected: 4

Test that control never hits flash busy.
Actual: 0 | Expected: 0

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 6: Robust: Flash is busy.

Test that the state has remained constant.
Actual: 4 | Expected: 4

Test that control was stuck in the flash busy loop correctly.
Actual: 3 | Expected: 3

Test that active control was entered
Actual (address): 0xb501b958 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 7: Robust: Sensor error.

Test that the sensor command error was handled correctly.
Actual: 36 | Expected: 36

-> END TEST CASE

-> BEGIN TEST CASE 8: Robust: FC in an invalid state for the loop

Test that the state has not changed if indeterminate.
Actual: 1 | Expected: 1

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control wasn't entered
Actual (address): 0xb501b95c | Expected (address): 0xf481bffc

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 25
Group Fails:  0
--END TEST GROUP: Flight Loop: Ascent (in_flight)--


--BEGIN TEST GROUP: Flight Loop: Coast--

-> BEGIN TEST CASE 0: Normal: Typical operation, coast not detected.

Test that the state has remained constant.
Actual: 5 | Expected: 5

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501ba08 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 1: Normal: Typical operation, coast detected.

Test that the state has been advanced.
Actual: 6 | Expected: 6

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control was entered
Actual (address): 0xb501ba08 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 2: Normal: Active roll not configured, coast not detected.

Test that the state has remained constant.
Actual: 5 | Expected: 5

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

Test that active control wasn't entered
Actual (address): 0xb501ba0c | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 3: Normal: Flash full, apogee not detected.

Test that the state has remained constant.
Actual: 5 | Expected: 5

Test that control never hits flash busy.
Actual: 0 | Expected: 0

Test that active control was entered
Actual (address): 0xb501ba08 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 4: Robust: Flash is busy.

Test that the state has remained constant.
Actual: 5 | Expected: 5

Test that control was stuck in the flash busy loop correctly.
Actual: 3 | Expected: 3

Test that active control was entered
Actual (address): 0xb501ba08 | Expected (address): 0xf481bffc

-> END TEST CASE

-> BEGIN TEST CASE 5: Robust: Sensor error.

Test that the sensor command error was handled correctly.
Actual: 36 | Expected: 36

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 16
Group Fails:  0
--END TEST GROUP: Flight Loop: Coast--


--BEGIN TEST GROUP: Flight Loop: Chute Deployment--

-> BEGIN TEST CASE 0: Immediate Success

Test that main chute deployment was called the right number of times.
Actual: 1 | Expected: 1

Test that drogue chute deployment was called the right number of times.
Actual: 1 | Expected: 1

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

-> END TEST CASE

-> BEGIN TEST CASE 1: First Fail

Test that main chute deployment was called the right number of times.
Actual: 1 | Expected: 1

Test that drogue chute deployment was called the right number of times.
Actual: 2 | Expected: 2

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

-> END TEST CASE

-> BEGIN TEST CASE 2: Two Fails

Test that main chute deployment was called the right number of times.
Actual: 3 | Expected: 3

Test that drogue chute deployment was called the right number of times.
Actual: 2 | Expected: 2

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

-> END TEST CASE

-> BEGIN TEST CASE 3: Dual Deploy Disabled

Test that main chute deployment was called the right number of times.
Actual: 0 | Expected: 0

Test that drogue chute deployment was called the right number of times.
Actual: 0 | Expected: 0

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

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 12
Group Fails:  0
--END TEST GROUP: Flight Loop: Chute Deployment--


--BEGIN TEST GROUP: Flight Loop: Descent--

-> BEGIN TEST CASE 0: Normal: Typical operation.

Test that the state has remained constant.
Actual: 7 | Expected: 7

Test that control was stuck in the flash busy loop correctly.
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 1: Normal: Flash full.

Test that the state has remained constant.
Actual: 7 | Expected: 7

Test that control never hits flash busy.
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 2: Robust: Flash is busy.

Test that the state has remained constant.
Actual: 7 | Expected: 7

Test that control was stuck in the flash busy loop correctly.
Actual: 3 | Expected: 3

-> END TEST CASE

-> BEGIN TEST CASE 3: Robust: Sensor error.

Test that the sensor command error was handled correctly.
Actual: 36 | Expected: 36

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 7
Group Fails:  0
--END TEST GROUP: Flight Loop: Descent--


--BEGIN TEST GROUP: Flight Loop: Telemetry--

-> BEGIN TEST CASE 0: Test behavior when telemetry is disabled.

Test that the last telemetry state update was not caused by this function
Actual: 0 | Expected: 0

-> END TEST CASE

-> BEGIN TEST CASE 1: Test behavior when telemetry is enabled.

Test that the last telemetry state update was a synchronous update.
Actual: 1 | Expected: 1

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 2
Group Fails:  0
--END TEST GROUP: Flight Loop: Telemetry--


--BEGIN TEST GROUP: Roll Control--

-> BEGIN TEST CASE 0: Early return condition.

Test that the systick function was only called once (early return).
Actual: 1 | Expected: 1

-> END TEST CASE

-> BEGIN TEST CASE 1: No roll, no control.

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 45 | Expected: 45

Test that the angles equal the expected value (servo 2).
Actual: 45 | Expected: 45

Test that the angles equal the expected value (servo 3).
Actual: 45 | Expected: 45

Test that the angles equal the expected value (servo 4).
Actual: 45 | Expected: 45

-> END TEST CASE

-> BEGIN TEST CASE 2: Upper Bound.

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 55 | Expected: 55

Test that the angles equal the expected value (servo 2).
Actual: 55 | Expected: 55

Test that the angles equal the expected value (servo 3).
Actual: 55 | Expected: 55

Test that the angles equal the expected value (servo 4).
Actual: 55 | Expected: 55

-> END TEST CASE

-> BEGIN TEST CASE 3: Lower Bound.

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 35 | Expected: 35

Test that the angles equal the expected value (servo 2).
Actual: 35 | Expected: 35

Test that the angles equal the expected value (servo 3).
Actual: 35 | Expected: 35

Test that the angles equal the expected value (servo 4).
Actual: 35 | Expected: 35

-> END TEST CASE

-> BEGIN TEST CASE 4: Roll is 1, 2s elapsed. Test feedback on P value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 2).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 3).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 4).
Actual: 44 | Expected: 44

-> END TEST CASE

-> BEGIN TEST CASE 5: Roll is -1, 2s elapsed. Test feedback on P value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 2).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 3).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 4).
Actual: 46 | Expected: 46

-> END TEST CASE

-> BEGIN TEST CASE 6: Roll is 1, 2s elapsed. Test feedback on I value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 43 | Expected: 43

Test that the angles equal the expected value (servo 2).
Actual: 43 | Expected: 43

Test that the angles equal the expected value (servo 3).
Actual: 43 | Expected: 43

Test that the angles equal the expected value (servo 4).
Actual: 43 | Expected: 43

-> END TEST CASE

-> BEGIN TEST CASE 7: Roll is -1, 2s elapsed. Test feedback on I value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 47 | Expected: 47

Test that the angles equal the expected value (servo 2).
Actual: 47 | Expected: 47

Test that the angles equal the expected value (servo 3).
Actual: 47 | Expected: 47

Test that the angles equal the expected value (servo 4).
Actual: 47 | Expected: 47

-> END TEST CASE

-> BEGIN TEST CASE 8: Roll is 1, .5s elapsed. Test feedback on D value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 2).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 3).
Actual: 44 | Expected: 44

Test that the angles equal the expected value (servo 4).
Actual: 44 | Expected: 44

-> END TEST CASE

-> BEGIN TEST CASE 9: Roll is -1, .5s elapsed. Test feedback on D value

Test that the systick function was called more than once (no early return).
Actual: 3 | Expected: 1

Test that the angles equal the expected value (servo 1).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 2).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 3).
Actual: 46 | Expected: 46

Test that the angles equal the expected value (servo 4).
Actual: 46 | Expected: 46

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 46
Group Fails:  0
--END TEST GROUP: Roll Control--


--BEGIN TEST GROUP: Rate limiter--

-> BEGIN TEST CASE 0: Rate limiter disabled

Test that store_frame was called
Actual: TRUE | Expected: TRUE

-> END TEST CASE

-> BEGIN TEST CASE 1: Rate limiter enabled, enough time elapsed

Test that store_frame was called
Actual: TRUE | Expected: TRUE

-> END TEST CASE

-> BEGIN TEST CASE 2: Rate limiter enabled, not enough time elapsed

Test that store_frame was not called
Actual: FALSE | Expected: FALSE

-> END TEST CASE

--TEST GROUP RESULTS:--
Group Passes: 3
Group Fails:  0
--END TEST GROUP: Rate limiter--

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