Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
test_systemDiagnostics.cpp
Go to the documentation of this file.
1
#include "
model/systemDiagnostics.hpp
"
2
#include "unity.h"
3
4
void
test_hasAnyComponentTimedOut
(
void
) {
5
FailureDetection
fd;
6
TEST_ASSERT_FALSE(fd.
has_any_component_timed_out
());
7
delay(
COMPONENT_TIMESTAMP_TIMEOUT
+ 1);
8
TEST_ASSERT_TRUE(fd.
has_any_component_timed_out
());
9
}
10
11
void
setUp
(
void
) {}
12
13
void
tearDown
(
void
) {}
14
15
int
main
() {
16
UNITY_BEGIN();
17
RUN_TEST(
test_hasAnyComponentTimedOut
);
18
return
UNITY_END();
19
}
COMPONENT_TIMESTAMP_TIMEOUT
constexpr int COMPONENT_TIMESTAMP_TIMEOUT
Definition
digitalSettings.hpp:3
FailureDetection
Definition
systemDiagnostics.hpp:57
FailureDetection::has_any_component_timed_out
bool has_any_component_timed_out()
Definition
systemDiagnostics.hpp:75
systemDiagnostics.hpp
setUp
void setUp(void)
Definition
test_systemDiagnostics.cpp:11
tearDown
void tearDown(void)
Definition
test_systemDiagnostics.cpp:13
test_hasAnyComponentTimedOut
void test_hasAnyComponentTimedOut(void)
Definition
test_systemDiagnostics.cpp:4
main
int main()
Definition
test_systemDiagnostics.cpp:15
master
test
test_model
test_systemDiagnostics.cpp
Generated by
1.9.8