PX4 Firmware
PX4 Autopilot Software http://px4.io
StateMachineHelperTest Class Reference
Inheritance diagram for StateMachineHelperTest:
Collaboration diagram for StateMachineHelperTest:

Public Member Functions

 StateMachineHelperTest ()=default
 
 ~StateMachineHelperTest () override=default
 
bool run_tests () override
 Override to run your unit tests. More...
 
- Public Member Functions inherited from UnitTest
 UnitTest ()=default
 
virtual ~UnitTest ()=default
 
void print_results ()
 Prints results from running of unit tests. More...
 

Private Member Functions

bool armingStateTransitionTest ()
 
bool mainStateTransitionTest ()
 
bool isSafeTest ()
 

Additional Inherited Members

- Protected Member Functions inherited from UnitTest
virtual void _init (void)
 Run before each unit test. Override to provide custom behavior. More...
 
virtual void _cleanup (void)
 Run after each unit test. Override to provide custom behavior. More...
 
void _print_assert (const char *msg, const char *test, const char *file, int line)
 
void _print_compare (const char *msg, const char *v1_text, int v1, const char *v2_text, int v2, const char *file, int line)
 
- Protected Attributes inherited from UnitTest
int _tests_run {0}
 The number of individual unit tests run. More...
 
int _tests_failed {0}
 The number of unit tests which failed. More...
 
int _tests_passed {0}
 The number of unit tests which passed. More...
 
int _assertions {0}
 Total number of assertions tested by all unit tests. More...
 

Detailed Description

Definition at line 47 of file state_machine_helper_test.cpp.

Constructor & Destructor Documentation

◆ StateMachineHelperTest()

StateMachineHelperTest::StateMachineHelperTest ( )
default

◆ ~StateMachineHelperTest()

StateMachineHelperTest::~StateMachineHelperTest ( )
overridedefault

Member Function Documentation

◆ armingStateTransitionTest()

bool StateMachineHelperTest::armingStateTransitionTest ( )
private

◆ isSafeTest()

bool StateMachineHelperTest::isSafeTest ( )
private

Definition at line 539 of file state_machine_helper_test.cpp.

References actuator_armed_s::armed, is_safe(), actuator_armed_s::lockdown, safety_s::safety_off, safety_s::safety_switch_available, and ut_compare.

Referenced by run_tests().

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

◆ mainStateTransitionTest()

bool StateMachineHelperTest::mainStateTransitionTest ( )
private

◆ run_tests()

bool StateMachineHelperTest::run_tests ( )
overridevirtual

Override to run your unit tests.

Unit tests should be called using ut_run_test macro.

Returns
true: all unit tests succeeded, false: one or more unit tests failed

Implements UnitTest.

Definition at line 577 of file state_machine_helper_test.cpp.

References UnitTest::_tests_failed, armingStateTransitionTest(), isSafeTest(), mainStateTransitionTest(), stateMachineHelperTest(), ut_declare_test, and ut_run_test.

Here is the call graph for this function:

The documentation for this class was generated from the following file: