PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Public Member Functions | |
void | SetUp () override |
virtual bool | run_tests () |
Override to run your unit tests. More... | |
ParameterTest () | |
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 | _assert_parameter_int_value (param_t param, int32_t expected) |
bool | _assert_parameter_float_value (param_t param, float expected) |
bool | _set_all_int_parameters_to (int32_t value) |
bool | SimpleFind () |
bool | ResetAll () |
bool | ResetAllExcludesOne () |
bool | ResetAllExcludesTwo () |
bool | ResetAllExcludesBoundaryCheck () |
bool | ResetAllExcludesWildcard () |
bool | exportImport () |
bool | exportImportAll () |
Private Attributes | |
param_t | p0 {PARAM_INVALID} |
param_t | p1 {PARAM_INVALID} |
param_t | p2 {PARAM_INVALID} |
param_t | p3 {PARAM_INVALID} |
param_t | p4 {PARAM_INVALID} |
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... | |
Definition at line 41 of file ParameterTest.cpp.
|
inline |
Definition at line 54 of file test_parameters.cpp.
References p0, p1, p2, p3, p4, and param_find().
|
private |
Definition at line 100 of file test_parameters.cpp.
References param_get(), ut_compare, and ut_compare_float.
|
private |
Definition at line 90 of file test_parameters.cpp.
References param_get(), and ut_compare.
Referenced by _set_all_int_parameters_to(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 110 of file test_parameters.cpp.
References _assert_parameter_int_value(), p0, p1, p2, p3, and param_set().
Referenced by ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 226 of file test_parameters.cpp.
References f(), p0, p1, p2, p3, p4, param_get(), param_load_default(), param_save_default(), param_set_no_notification(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, ut_assert, ut_compare, and ut_compare_float.
Referenced by run_tests().
|
private |
Definition at line 353 of file test_parameters.cpp.
References fd, param_count(), param_export(), param_for_index(), param_get(), param_import(), PARAM_INVALID, param_load_default(), param_reset_all(), param_save_default(), param_set_no_notification(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, ut_assert, and ut_compare.
Referenced by run_tests().
|
private |
Definition at line 142 of file test_parameters.cpp.
References _assert_parameter_int_value(), _set_all_int_parameters_to(), p0, p1, p2, p3, and param_reset_all().
Referenced by run_tests().
|
private |
Definition at line 192 of file test_parameters.cpp.
References _assert_parameter_int_value(), _set_all_int_parameters_to(), p0, p1, p2, p3, and param_reset_excludes().
Referenced by run_tests().
|
private |
Definition at line 158 of file test_parameters.cpp.
References _assert_parameter_int_value(), _set_all_int_parameters_to(), p0, p1, p2, p3, and param_reset_excludes().
Referenced by run_tests().
|
private |
Definition at line 175 of file test_parameters.cpp.
References _assert_parameter_int_value(), _set_all_int_parameters_to(), p0, p1, p2, p3, and param_reset_excludes().
Referenced by run_tests().
|
private |
Definition at line 209 of file test_parameters.cpp.
References _assert_parameter_int_value(), _set_all_int_parameters_to(), p0, p1, p2, p3, and param_reset_excludes().
Referenced by run_tests().
|
virtual |
Override to run your unit tests.
Unit tests should be called using ut_run_test macro.
Implements UnitTest.
Definition at line 536 of file test_parameters.cpp.
References UnitTest::_tests_failed, exportImport(), exportImportAll(), param_control_autosave(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), ResetAllExcludesWildcard(), SimpleFind(), test_parameters(), ut_declare_test_c, and ut_run_test.
|
inlineoverride |
Definition at line 44 of file ParameterTest.cpp.
References param_reset_all().
|
private |
Definition at line 127 of file test_parameters.cpp.
References param_find(), param_get(), PARAM_INVALID, ut_assert_true, and ut_compare.
Referenced by run_tests().
|
private |
Definition at line 65 of file test_parameters.cpp.
Referenced by _set_all_int_parameters_to(), exportImport(), ParameterTest(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 66 of file test_parameters.cpp.
Referenced by _set_all_int_parameters_to(), exportImport(), ParameterTest(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 67 of file test_parameters.cpp.
Referenced by _set_all_int_parameters_to(), exportImport(), ParameterTest(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 68 of file test_parameters.cpp.
Referenced by _set_all_int_parameters_to(), exportImport(), ParameterTest(), ResetAll(), ResetAllExcludesBoundaryCheck(), ResetAllExcludesOne(), ResetAllExcludesTwo(), and ResetAllExcludesWildcard().
|
private |
Definition at line 69 of file test_parameters.cpp.
Referenced by exportImport(), and ParameterTest().