#include "../Inc/Systems/Controller/BrakeSystemControl.h"
Go to the source code of this file.
|
int | testBrakeSystemControlInit (int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, const char *testName) |
|
int | testFrontPressure (int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float pressure, BrakeSystemStatus desiredStatus, const char *testName) |
|
int | testRearPressure (int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float pressure, BrakeSystemStatus desiredStatus, const char *testName) |
|
int | testTemperature (int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float temperature, BrakeSystemStatus desiredStatus, const char *testName) |
|
int | brake_main () |
|
◆ brake_main()
Definition at line 66 of file BrakeSystemControlTest.c.
66 {
67 int tests_failed = 0;
68
79
80 if (tests_failed == 0) {
81 printf("All tests passed.\n");
82 } else {
83 printf("Some tests failed.\n");
84 }
85
86 return tests_failed;
87}
int testRearPressure(int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float pressure, BrakeSystemStatus desiredStatus, const char *testName)
int testBrakeSystemControlInit(int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, const char *testName)
int testFrontPressure(int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float pressure, BrakeSystemStatus desiredStatus, const char *testName)
int testTemperature(int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, float temperature, BrakeSystemStatus desiredStatus, const char *testName)
@ TEMPERATURE_SENSOR_ERROR
◆ testBrakeSystemControlInit()
int testBrakeSystemControlInit |
( |
int |
maxTemp, |
|
|
int |
brakeLightActivationPoint, |
|
|
int |
heavyBrakingActivationPoint, |
|
|
const char * |
testName |
|
) |
| |
Definition at line 3 of file BrakeSystemControlTest.c.
3 {
6
8 printf("%s Failed: Initial status is not OK.\n", testName);
9 return 1;
10 }
11 else{
12 printf("%s Failed: Initial status is OK.\n", testName);
13 return 0;
14 }
15}
void initBrakeSystemControl(BrakeSystemControl *bsc, int hz, int maxTemp, int brakeLightActivationPoint, int heavyBrakingActivationPoint, int fbp_channel, int rbp_channel, int temp_channel)
Initializes the Braking System with initial settings.
◆ testFrontPressure()
int testFrontPressure |
( |
int |
maxTemp, |
|
|
int |
brakeLightActivationPoint, |
|
|
int |
heavyBrakingActivationPoint, |
|
|
float |
pressure, |
|
|
BrakeSystemStatus |
desiredStatus, |
|
|
const char * |
testName |
|
) |
| |
Definition at line 17 of file BrakeSystemControlTest.c.
17 {
21
23 if (status != desiredStatus){
24 printf("%s Failed: Status after update is incorrect, actual status: %d.\n", testName, status);
25 return 1;
26 }
27 else{
28 printf("%s Passed: Status after update is correct.\n", testName);
29 return 0;
30 }
31}
void setFrontPressure(BrakeSystemControl *bsc, float pressure)
BrakeSystemStatus checkSensorLimits(BrakeSystemControl *bsc)
Checks if the brake system is within the defined limits and desired ranges.
◆ testRearPressure()
int testRearPressure |
( |
int |
maxTemp, |
|
|
int |
brakeLightActivationPoint, |
|
|
int |
heavyBrakingActivationPoint, |
|
|
float |
pressure, |
|
|
BrakeSystemStatus |
desiredStatus, |
|
|
const char * |
testName |
|
) |
| |
Definition at line 33 of file BrakeSystemControlTest.c.
33 {
37
39 if (status != desiredStatus){
40 printf("%s Failed: Status after update is incorrect, actual status: %d.\n", testName, status);
41 return 1;
42 }
43 else{
44 printf("%s Passed: Status after update is correct.\n", testName);
45 return 0;
46 }
47}
void setRearPressure(BrakeSystemControl *bsc, float pressure)
◆ testTemperature()
int testTemperature |
( |
int |
maxTemp, |
|
|
int |
brakeLightActivationPoint, |
|
|
int |
heavyBrakingActivationPoint, |
|
|
float |
temperature, |
|
|
BrakeSystemStatus |
desiredStatus, |
|
|
const char * |
testName |
|
) |
| |
Definition at line 49 of file BrakeSystemControlTest.c.
49 {
53
55 if (status != desiredStatus){
56 printf("%s Failed: Status after update is incorrect, actual status: %d.\n", testName, status);
57 return 1;
58 }
59 else{
60 printf("%s Passed: Status after update is correct.\n", testName);
61 return 0;
62 }
63}
void setTemperature(BrakeSystemControl *bsc, float temperature)