|
Formula Student Electronics & Software
The code for the embedded software
|
#include "comm/communicator.hpp"#include "embedded/digitalSender.hpp"#include "logic/stateLogic.hpp"#include "model/systemData.hpp"#include "unity.h"
Go to the source code of this file.
Macros | |
| #define | HYDRAULIC_PRESSURE_HIGH 0xf8 |
| #define | HYDRAULIC_PRESSURE_LOW 0x01 |
| #define | BAMOCAR_VDC_HIGH 0x11 |
| #define | RES_GO 0x02 |
Functions | |
| void | reset () |
| Auxiliary function to reset data values. | |
| void | to_ready () |
| Auxiliary function to set state as ready. | |
| void | test_off_to_ready_success (void) |
| Test function to validate AS_OFF to AS_Ready transition normal and successful transition. | |
| void | test_off_to_ready_recheck () |
| Test function to validate AS_OFF to AS_Ready transition with checks reverting to invalid mid transition. | |
| void | test_off_to_ready_wayback_impossible () |
| Test function to validate AS_READY doesn't revert to AS_Ready. | |
| void | test_ready_to_emg_to_off () |
| Test function to validate AS_READY to AS_Emergency and the AS_EMERGENCY to AS_OFF transition. | |
| void | test_ready_to_driving_to_emg () |
| Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if brakes still active after timeout. | |
| void | test_ready_to_driving_to_emg2 () |
| Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if failure occurs. | |
| void | test_driving_to_finished_to_off () |
| Test function to validate AS_DRIVING to AS_FINISHED transition and AS_FINISHED to AS_OFF after. | |
| void | test_finished_to_emg () |
| Test function to validate AS_FINISHED to AS_EMERGENCY transition if RES is activated after mission finished. | |
| void | test_off_to_manual_wayback () |
| Test function to validate AS_OFF to AS_Manual transition and the other way around. | |
| void | test_flow_driving () |
| Test function to validate flow diagram conditions to go AS_DRIVING. | |
| void | test_flow_ready () |
| Test function to validate flow diagram conditions to go AS_READY. | |
| void | test_flow_emergency () |
| Test function to validate flow diagram conditions to go AS_EMERGENCY. | |
| void | test_flow_finished () |
| Test function to validate flow diagram conditions to go AS_FINISHED. | |
| void | setUp () |
| int | main () |
Variables | |
| SystemData | sd |
| Communicator | communicator = Communicator(&sd) |
| DigitalSender | digitalSender = DigitalSender() |
| ASState | as_state = ASState(&sd, &communicator, &digitalSender) |
| #define BAMOCAR_VDC_HIGH 0x11 |
Definition at line 9 of file test_integration.cpp.
| #define HYDRAULIC_PRESSURE_HIGH 0xf8 |
Definition at line 7 of file test_integration.cpp.
| #define HYDRAULIC_PRESSURE_LOW 0x01 |
Definition at line 8 of file test_integration.cpp.
| #define RES_GO 0x02 |
Definition at line 10 of file test_integration.cpp.
| int main | ( | void | ) |
| void reset | ( | ) |
Auxiliary function to reset data values.
Definition at line 20 of file test_integration.cpp.

| void setUp | ( | void | ) |
Definition at line 500 of file test_integration.cpp.
| void test_driving_to_finished_to_off | ( | ) |
Test function to validate AS_DRIVING to AS_FINISHED transition and AS_FINISHED to AS_OFF after.
Definition at line 289 of file test_integration.cpp.


| void test_finished_to_emg | ( | ) |
Test function to validate AS_FINISHED to AS_EMERGENCY transition if RES is activated after mission finished.
Definition at line 323 of file test_integration.cpp.


| void test_flow_driving | ( | ) |
Test function to validate flow diagram conditions to go AS_DRIVING.
Definition at line 368 of file test_integration.cpp.


| void test_flow_emergency | ( | ) |
Test function to validate flow diagram conditions to go AS_EMERGENCY.
Definition at line 448 of file test_integration.cpp.


| void test_flow_finished | ( | ) |
Test function to validate flow diagram conditions to go AS_FINISHED.
Definition at line 474 of file test_integration.cpp.


| void test_flow_ready | ( | ) |
Test function to validate flow diagram conditions to go AS_READY.
Definition at line 395 of file test_integration.cpp.


| void test_off_to_manual_wayback | ( | ) |
Test function to validate AS_OFF to AS_Manual transition and the other way around.
Definition at line 345 of file test_integration.cpp.


| void test_off_to_ready_recheck | ( | ) |
Test function to validate AS_OFF to AS_Ready transition with checks reverting to invalid mid transition.
Definition at line 81 of file test_integration.cpp.


| void test_off_to_ready_success | ( | void | ) |
Test function to validate AS_OFF to AS_Ready transition normal and successful transition.
Definition at line 63 of file test_integration.cpp.


| void test_off_to_ready_wayback_impossible | ( | ) |
Test function to validate AS_READY doesn't revert to AS_Ready.
Definition at line 127 of file test_integration.cpp.


| void test_ready_to_driving_to_emg | ( | ) |
Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if brakes still active after timeout.
Definition at line 185 of file test_integration.cpp.


| void test_ready_to_driving_to_emg2 | ( | ) |
Test function to validate AS_READY to AS_Driving transition and AS_DRIVING to AS_EMERGENCY if failure occurs.
Definition at line 252 of file test_integration.cpp.


| void test_ready_to_emg_to_off | ( | ) |
Test function to validate AS_READY to AS_Emergency and the AS_EMERGENCY to AS_OFF transition.
Definition at line 152 of file test_integration.cpp.


| void to_ready | ( | ) |
Auxiliary function to set state as ready.
Definition at line 28 of file test_integration.cpp.


| ASState as_state = ASState(&sd, &communicator, &digitalSender) |
Definition at line 15 of file test_integration.cpp.
| Communicator communicator = Communicator(&sd) |
Definition at line 13 of file test_integration.cpp.
| DigitalSender digitalSender = DigitalSender() |
Definition at line 14 of file test_integration.cpp.
| SystemData sd |
Definition at line 12 of file test_integration.cpp.