Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
test_integration.cpp File Reference
#include "comm/communicator.hpp"
#include "embedded/digitalSender.hpp"
#include "logic/stateLogic.hpp"
#include "model/systemData.hpp"
#include "unity.h"
Include dependency graph for test_integration.cpp:

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)
 

Macro Definition Documentation

◆ BAMOCAR_VDC_HIGH

#define BAMOCAR_VDC_HIGH   0x11

Definition at line 9 of file test_integration.cpp.

◆ HYDRAULIC_PRESSURE_HIGH

#define HYDRAULIC_PRESSURE_HIGH   0xf8

Definition at line 7 of file test_integration.cpp.

◆ HYDRAULIC_PRESSURE_LOW

#define HYDRAULIC_PRESSURE_LOW   0x01

Definition at line 8 of file test_integration.cpp.

◆ RES_GO

#define RES_GO   0x02

Definition at line 10 of file test_integration.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 502 of file test_integration.cpp.

Here is the call graph for this function:

◆ reset()

void reset ( )

Auxiliary function to reset data values.

Definition at line 20 of file test_integration.cpp.

Here is the caller graph for this function:

◆ setUp()

void setUp ( void  )

Definition at line 500 of file test_integration.cpp.

◆ test_driving_to_finished_to_off()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_finished_to_emg()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_flow_driving()

void test_flow_driving ( )

Test function to validate flow diagram conditions to go AS_DRIVING.

Definition at line 368 of file test_integration.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_flow_emergency()

void test_flow_emergency ( )

Test function to validate flow diagram conditions to go AS_EMERGENCY.

Definition at line 448 of file test_integration.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_flow_finished()

void test_flow_finished ( )

Test function to validate flow diagram conditions to go AS_FINISHED.

Definition at line 474 of file test_integration.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_flow_ready()

void test_flow_ready ( )

Test function to validate flow diagram conditions to go AS_READY.

Definition at line 395 of file test_integration.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_off_to_manual_wayback()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_off_to_ready_recheck()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_off_to_ready_success()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_off_to_ready_wayback_impossible()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ready_to_driving_to_emg()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ready_to_driving_to_emg2()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_ready_to_emg_to_off()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_ready()

void to_ready ( )

Auxiliary function to set state as ready.

Definition at line 28 of file test_integration.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ as_state

Definition at line 15 of file test_integration.cpp.

◆ communicator

Communicator communicator = Communicator(&sd)

Definition at line 13 of file test_integration.cpp.

◆ digitalSender

DigitalSender digitalSender = DigitalSender()

Definition at line 14 of file test_integration.cpp.

◆ sd

Definition at line 12 of file test_integration.cpp.