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

Public Member Functions

virtual bool run_tests ()
 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 _get_states_from_time ()
 
bool _get_arc_length ()
 
bool _set_bez_from_vel ()
 
float random (float min, float max)
 

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 46 of file test_bezierQuad.cpp.

Member Function Documentation

◆ _get_arc_length()

bool BezierQuadTest::_get_arc_length ( )
private

Definition at line 182 of file test_bezierQuad.cpp.

References f(), bezier::BezierQuad< Tp >::getArcLength(), bezier::BezierQuad< Tp >::getPoint(), math::max(), math::min(), random(), and ut_assert_true.

Referenced by run_tests().

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

◆ _get_states_from_time()

bool BezierQuadTest::_get_states_from_time ( )
private

Definition at line 71 of file test_bezierQuad.cpp.

References f(), bezier::BezierQuad< Tp >::getStates(), bezier::BezierQuad< Tp >::setBezier(), ut_assert_true, and ut_compare_float.

Referenced by run_tests().

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

◆ _set_bez_from_vel()

bool BezierQuadTest::_set_bez_from_vel ( )
private

Definition at line 235 of file test_bezierQuad.cpp.

References f(), bezier::BezierQuad< Tp >::getVelocity(), math::max(), random(), bezier::BezierQuad< Tp >::setBezFromVel(), and ut_compare_float.

Referenced by run_tests().

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

◆ random()

float BezierQuadTest::random ( float  min,
float  max 
)
private

Definition at line 271 of file test_bezierQuad.cpp.

References test_bezierQuad(), and ut_declare_test_c.

Referenced by _get_arc_length(), and _set_bez_from_vel().

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

◆ run_tests()

bool BezierQuadTest::run_tests ( )
virtual

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 62 of file test_bezierQuad.cpp.

References _get_arc_length(), _get_states_from_time(), _set_bez_from_vel(), UnitTest::_tests_failed, and ut_run_test.

Here is the call graph for this function:

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