Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
test_callbacks.cpp File Reference
#include <unity.h>
#include "comm/communicator.hpp"
#include "model/systemDiagnostics.hpp"
Include dependency graph for test_callbacks.cpp:

Go to the source code of this file.

Macros

#define BAMOCAR_VDC_HIGH   0x11
 
#define BAMOCAR_VDC_LOW   0x01
 
#define RES_READY_TRUE   0x01
 
#define RADIO_QUALITY_0   0x00
 
#define RADIO_QUALITY_100   0x64
 
#define RES_EMG_0   0x00
 
#define RES_EMG_3   0x00
 
#define RES_OK_0   0x01
 
#define RES_OK_3   0x80
 

Functions

void wss_message_zero_rpm (void)
 Test if the message wheel rpm message is created correctly for a 0.0 rpm value.
 
void wss_message_high_rpm (void)
 Test if the message wheel rpm message is created correctly for a large rpm value.
 
void wss_message_negative_rpm (void)
 Test if the message wheel rpm message is created correctly for a negative rpm value.
 
void wss_message_small_rpm (void)
 Test if the message wheel rpm message is created correctly for a small rpm value.
 
void test_c1 (void)
 Tests if the messages from C1 are correctly parsed for Hydraulic Brake Pressure and Right Wheel Rpm's.
 
void test_bamocar (void)
 Tests if the messages from Bamocar are correctly parsed and the Tractive System State is matching received info.
 
void test_res_state (void)
 Tests if the messages from RES are correctly parsed for R2D and Emergency activations, aswell as for the radio quality indicator.
 
void setUp ()
 
int main (void)
 

Variables

SystemData sd
 
CAN_message_t msg
 

Macro Definition Documentation

◆ BAMOCAR_VDC_HIGH

#define BAMOCAR_VDC_HIGH   0x11

Definition at line 6 of file test_callbacks.cpp.

◆ BAMOCAR_VDC_LOW

#define BAMOCAR_VDC_LOW   0x01

Definition at line 7 of file test_callbacks.cpp.

◆ RADIO_QUALITY_0

#define RADIO_QUALITY_0   0x00

Definition at line 9 of file test_callbacks.cpp.

◆ RADIO_QUALITY_100

#define RADIO_QUALITY_100   0x64

Definition at line 10 of file test_callbacks.cpp.

◆ RES_EMG_0

#define RES_EMG_0   0x00

Definition at line 11 of file test_callbacks.cpp.

◆ RES_EMG_3

#define RES_EMG_3   0x00

Definition at line 12 of file test_callbacks.cpp.

◆ RES_OK_0

#define RES_OK_0   0x01

Definition at line 13 of file test_callbacks.cpp.

◆ RES_OK_3

#define RES_OK_3   0x80

Definition at line 14 of file test_callbacks.cpp.

◆ RES_READY_TRUE

#define RES_READY_TRUE   0x01

Definition at line 8 of file test_callbacks.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 178 of file test_callbacks.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void  )

Definition at line 176 of file test_callbacks.cpp.

◆ test_bamocar()

void test_bamocar ( void  )

Tests if the messages from Bamocar are correctly parsed and the Tractive System State is matching received info.

Definition at line 106 of file test_callbacks.cpp.

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

◆ test_c1()

void test_c1 ( void  )

Tests if the messages from C1 are correctly parsed for Hydraulic Brake Pressure and Right Wheel Rpm's.

Definition at line 80 of file test_callbacks.cpp.

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

◆ test_res_state()

void test_res_state ( void  )

Tests if the messages from RES are correctly parsed for R2D and Emergency activations, aswell as for the radio quality indicator.

Definition at line 138 of file test_callbacks.cpp.

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

◆ wss_message_high_rpm()

void wss_message_high_rpm ( void  )

Test if the message wheel rpm message is created correctly for a large rpm value.

Definition at line 39 of file test_callbacks.cpp.

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

◆ wss_message_negative_rpm()

void wss_message_negative_rpm ( void  )

Test if the message wheel rpm message is created correctly for a negative rpm value.

Definition at line 53 of file test_callbacks.cpp.

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

◆ wss_message_small_rpm()

void wss_message_small_rpm ( void  )

Test if the message wheel rpm message is created correctly for a small rpm value.

Definition at line 67 of file test_callbacks.cpp.

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

◆ wss_message_zero_rpm()

void wss_message_zero_rpm ( void  )

Test if the message wheel rpm message is created correctly for a 0.0 rpm value.

Definition at line 25 of file test_callbacks.cpp.

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

Variable Documentation

◆ msg

CAN_message_t msg

Definition at line 18 of file test_callbacks.cpp.

◆ sd

Definition at line 16 of file test_callbacks.cpp.