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

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 testVector2 ()
 
bool testVector3 ()
 
bool testVector10 ()
 
bool testMatrix3x3 ()
 
bool testMatrix10x10 ()
 
bool testMatrixNonsymmetric ()
 
bool testRotationMatrixQuaternion ()
 
bool testQuaternionfrom_dcm ()
 
bool testQuaternionfrom_euler ()
 
bool testQuaternionRotate ()
 
bool testFinite ()
 

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 65 of file test_mathlib.cpp.

Member Function Documentation

◆ run_tests()

bool MathlibTest::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 393 of file test_mathlib.cpp.

References UnitTest::_tests_failed, test_mathlib(), testFinite(), testMatrix3x3(), testMatrixNonsymmetric(), testQuaternionfrom_dcm(), testQuaternionfrom_euler(), testQuaternionRotate(), testRotationMatrixQuaternion(), testVector2(), testVector3(), ut_declare_test_c, and ut_run_test.

Here is the call graph for this function:

◆ testFinite()

bool MathlibTest::testFinite ( )
private

Definition at line 375 of file test_mathlib.cpp.

References f(), and ut_assert.

Referenced by run_tests().

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

◆ testMatrix10x10()

bool MathlibTest::testMatrix10x10 ( )
private

◆ testMatrix3x3()

bool MathlibTest::testMatrix3x3 ( )
private

Definition at line 145 of file test_mathlib.cpp.

References f(), matrix::Matrix< Type, M, N >::identity(), and TEST_OP.

Referenced by run_tests().

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

◆ testMatrixNonsymmetric()

bool MathlibTest::testMatrixNonsymmetric ( )
private

Definition at line 160 of file test_mathlib.cpp.

References matrix::Matrix< Type, M, N >::print(), and ut_assert.

Referenced by run_tests().

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

◆ testQuaternionfrom_dcm()

bool MathlibTest::testQuaternionfrom_dcm ( )
private

Definition at line 255 of file test_mathlib.cpp.

References matrix::Quaternion< Type >::from_dcm(), matrix::Matrix< Type, M, N >::identity(), and ut_assert.

Referenced by run_tests().

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

◆ testQuaternionfrom_euler()

bool MathlibTest::testQuaternionfrom_euler ( )
private

Definition at line 274 of file test_mathlib.cpp.

References f(), matrix::Quaternion< Type >::from_dcm(), matrix::Matrix< Type, M, N >::identity(), M_PI_F, and ut_assert.

Referenced by run_tests().

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

◆ testQuaternionRotate()

bool MathlibTest::testQuaternionRotate ( )
private

Definition at line 309 of file test_mathlib.cpp.

References matrix::Quaternion< Type >::conjugate(), f(), M_PI_F, and ut_assert.

Referenced by run_tests().

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

◆ testRotationMatrixQuaternion()

bool MathlibTest::testRotationMatrixQuaternion ( )
private

Definition at line 224 of file test_mathlib.cpp.

References M_PI_F, and ut_assert.

Referenced by run_tests().

Here is the caller graph for this function:

◆ testVector10()

bool MathlibTest::testVector10 ( )
private

◆ testVector2()

bool MathlibTest::testVector2 ( )
private

Definition at line 88 of file test_mathlib.cpp.

References data, f(), TEST_OP, ut_assert_true, and matrix::Matrix< Type, M, N >::zero().

Referenced by run_tests().

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

◆ testVector3()

bool MathlibTest::testVector3 ( )
private

Definition at line 110 of file test_mathlib.cpp.

References data, f(), TEST_OP, ut_assert_true, and matrix::Matrix< Type, M, N >::zero().

Referenced by run_tests().

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

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